TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #425 · 20 апр.

Недавно делал быстрый прототип асинхронного приложения в котором требовалось вызывать много синхронного кода. Да, я знаю, что это не лучший дизайн, но нужно было быстрое решение на один процесс и без очередей. Поэтому я выполнял код в потоках. Выглядело это примерно так: from fastapi.concurrency import run_in_threadpool async def execute(data: DataRequest) -> DataResponse: try: result = await run_in_threadpool(sync_function, data) return DataResponse(data=result) except Exception as e: return DataResponse( error=str(e), success=False, ) В общем работает нормально. Для всех вызовов под капотом используется общий тредпул, всё работает предсказуемо. Но потребовалось изменить количество запускаемых в пуле потоков (по умолчанию создается 40 воркеров). Так как дело происходит с FastAPI, делается это через lifespan используя настройки anyio: import anyio @asynccontextmanager async def lifespan(app: FastAPI): limiter = anyio.to_thread.current_default_thread_limiter() limiter.total_tokens = 100 yield # если вдруг нужно вернуть обратно limiter.total_tokens = 40 Зачем менять количество воркеров? - уменьшить, если оперативки мало (один тред занимает ~8мб) - увеличить чтобы выдержать нагрузку Если есть предложения получше при тех же вводных - предлагайте😉 #async

Hashtags

Резултати

Пронајдени 6 слични објави

Пребарај: #recognition

当前筛选 #recognition清除筛选
Libreware

@libreware · Post #1084 · 04.05.2022 г., 09:32

Vosk Speech Recognition Toolkit Vosk is an offline open source #speech#recognition toolkit. It enables speech recognition for 20+ languages and dialects - English, Indian English, German, French, Spanish, Portuguese, Chinese, Russian, Turkish, Vietnamese, Italian, Dutch, Catalan, Arabic, Greek, Farsi, Filipino, Ukrainian, Kazakh, Swedish, Japanese, Esperanto, Hindi, Czech. More to come. Vosk models are small (50 Mb) but provide continuous large vocabulary transcription, zero-latency response with streaming API, reconfigurable vocabulary and speaker identification. Speech recognition bindings implemented for various programming languages like Python, Java, Node.JS, C#, C++ and others. Vosk supplies speech recognition for chatbots, smart home appliances, virtual assistants. It can also create subtitles for movies, transcription for lectures and interviews. Vosk scales from small devices like Raspberry Pi or Android smartphone to big clusters. https://t.me/speech_recognition https://alphacephei.com/vosk https://github.com/alphacep/vosk-api

Libreware

@libreware · Post #1021 · 09.01.2022 г., 14:56

SongRec An open-source Shazam client for Linux, written in Rust. Features: • Recognize audio from an audio file. • Recognize audio from the microphone. • Usage from both GUI and command line. • Provide an history of the recognized songs. • Continuous song detection. • Ability to recognize songs from your speakers rather than your microphone. Download: https://github.com/marin-m/SongRec#installation https://github.com/marin-m/SongRec @foss_desktop #music#shazam#recognition

Libreware

@libreware · Post #1192 · 06.10.2023 г., 11:18

#Linux Desktop application that provides live #captioning FUTO Fellowship program interview; linux captions software 👉 Live Captions github: https://github.com/abb128/LiveCaptions 🔵 Q&A w/ billionaire alt-tech investor/philanthropist Eron Wolf https://www.youtube.com/watch?v=OJPmbcU-Vzo 🔵 FUTO Fellows program: https://futo.org/fellows/ 🔵 FUTO Youtube channel - @futotech ⚠️ Google's breaches of privacy have gone TOO FAR! https://www.youtube.com/watch?v=_vWAF13KigI #speech#recognition#stt#voice

Libreware

@libreware · Post #1114 · 09.03.2023 г., 22:58

https://writeout.ai #Transcribe and #translate any #audio file. 100% free to use. This website with source code available (it can be hosted locally) allows you to upload any audio file and receive a transcription and/or text translation. It uses OpenAI's Whisper API on the back end. Source on GitHub: https://github.com/beyondcode/writeout.ai #writeout#ai#speech#recognition