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

Резултати

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

Пребарај: #abroad

当前筛选 #abroad清除筛选
Data Science Jobs

@datasciencejobs · Post #1878 · 18.01.2024 г., 13:01

#вакансия#remotely#abroad#удаленка#DataScientist Вакансия: Senior Data Scientist Локация: Рассматриваются кандидаты за пределами России и Белоруссии Занятость: Полная График работы: Гибкий Зарплата: $4000 – 4500 на руки Для связи: https://t.me/Tary_bird, [email protected] Описание: Ищем опытного Senior Data Scientist для участия в проекте крупного американского маркетингового агентства. Оформление в штат в Армении. Требуется владение английским не ниже уровня B2. Responsibilities: • Develop real-time prediction systems using geospatial machine learning algorithms. • Mine and extract usable data from valuable sources. • Advanced visualization of geo-temporal algorithms. • Use machine learning tools to select features, create and optimize classifiers. • Conduct preprocessing of structured and unstructured data. • Enhance systems using LLM AI models. • Improve data collection procedures for comprehensive analytic system development. Key Skills: • Programming: Knowledge of statistical programming languages like R, Python, and database query languages like SQL, Hive, Pig is desirable. Familiarity with Scala, Java, or C++ is an added advantage. • Statistics: Good applied statistical skills, including knowledge of statistical tests, distributions, regression, maximum likelihood estimators, etc. • Machine Learning: Good knowledge of machine learning methods like k-Nearest Neighbors, Naive Bayes, SVM, Decision Forests. • Strong Math Skills: Understanding the fundamentals of Multivariable Calculus and Linear Algebra is important. • Data Wrangling: Proficiency in handling imperfections in data. • Data Visualization: Experience with tools like Matplotlib, ggplot, d3.js., Tableau for visually encoding data. • Communication Skills: Ability to describe findings to both technical and non-technical audiences. • Software Engineering Background: Strong background in software engineering. • Hands-on Experience: With data science tools and a problem-solving aptitude. • Analytical Mind: Strong analytical skills and great business sense. • Degree: In Computer Science, Data Science, Mathematics, Statistics Preferred Additional Skills: • Experience with geospatial analysis and GIS. • Knowledge of H3 hierarchical geospatial indexing or other geospatial indexes. • Familiarity with open-source geographical datasets. • Experience or familiarity with advertising technology concepts. • Experience with artificial intelligence, especially with LLM and other generative technologies.