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

Резултати

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

Пребарај: #digitalethics

当前筛选 #digitalethics清除筛选
AI & Law

@ai_and_law · Post #402 · 23.09.2024 г., 07:04

California Leads in Protecting Performers from AI Clones California Governor Gavin Newsom has signed two key bills, AB 2602 and AB 1836, aimed at safeguarding performers' rights against AI-generated digital replicas. AB 2602 ensures that performers must consent to how their likeness is used and mandates legal or union representation during such negotiations. Meanwhile, AB 1836 requires entertainment companies to obtain permission from a performer’s family or estate before using their likeness after death, closing a potential loophole for AI companies. #AIGovernance#DigitalEthics#AIRegulation

AI & Law

@ai_and_law · Post #72 · 01.08.2023 г., 07:04

Navigating the Future of AI Governance: IAPP Introduces AIGP Certification Hello, AI enthusiasts! Exciting news from the International Association of Privacy Professionals (IAPP)! They have released the Artificial Intelligence Governance Professional Body of Knowledge (BoK), a foundational document for the upcoming AIGP certification and training. This certification presents a brand new learning opportunity for legal professionals in the AI domain: 🔹 A Path to Safe and Trustworthy AI: The BoK outlines the knowledge and skills required for AI governance professionals to guide AI implementation responsibly. 🔹 A Living Document for an Ever-Changing Landscape: In a rapidly evolving world, updates to the BoK will be reviewed every six months to ensure it remains up-to-date. 🔹 Empowering Professionals for New Responsibilities: As generative AI increasingly integrates into business operations, organizations face both excitement and concern. The BoK equips professionals from diverse backgrounds to navigate legal and ethical challenges and take a proactive approach to risk mitigation. 🔹 A Collaborative Effort: The BoK is the result of a remarkable collaboration between the IAPP and leading voices from privacy, law, ethics, academia, computer science, and more. 🔹 Elevating AI Governance Professionals: With AI initiatives becoming integral to various organizations, privacy professionals are well-positioned to take the lead. The AIGP certification empowers them to gain the necessary knowledge and expertise to excel in AI governance roles. It's a wonderful new opportunity for legal professionals to advance their expertise in the exciting field of AI! #AIandLaw#AIRegulation#IAPP#DigitalEthics#AIinBusiness#AIcertification

iGlobal Community

@iGlobalCom · Post #1424 · 30.01.2026 г., 12:58

#партнерскийпост Вышла новая колонка Forbes нашего друга, community-архитектора, сооснователя @wowsummitworld, Forbes Councils Member, Guy Yanpolskiy — про то, куда движется AI и какие вопросы уже нельзя откладывать «на потом». 🧠AI: переход от промптов к системам — приватность и ответственность Мы быстро уходим от формата «поговорить с моделью» к полноценным AI-системам, встроенным в бизнес-процессы и принимающим решения. И здесь на первый план выходят не технологии, а правила игры: • как защищается приватность данных • где проходит граница между ассистентом и автономной системой • кто и как несёт ответственность за последствия решений AI Очень своевременное размышление, особенно для тех, кто уже внедряет AI в продукты, аналитику, маркетинг и управление. 📖 Читать колонку: https://www.forbes.com/councils/forbesbusinesscouncil/2026/01/28/ais-shift-from-prompts-to-systems-privacy-and-accountability/ Вопрос автора на обсуждение: какой риск в AI для вас сейчас №1 — утечка данных, ошибки решений или отсутствие прозрачности? #AI#Forbes#приватность#безопасностьданных#governance#digitalethics#iGlobal#партнеры#GYFamily