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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #411 · 9 фев.

reload_flag="" if [[ -n "${DEBUG}" ]]; then reload_flag="--reload" fi if [[ -n "${WORKER_COUNT}" ]]; then workers=${WORKER_COUNT} else workers=2 fi gunicorn --workers ${workers} \ --bind 0.0.0.0:8000 \ ${reload_flag} main.wsgi Писали такие конструкции чтобы проверить наличие флага и сформировать команду правильно? На самом деле можно сделать тоже самое проще. Для этого используются операторы условной подстановки, доступные в оболочках семейства POSIX. :- для установки значений по умолчанию ${WORKER_COUNT:-2} Если переменная не объявлена, то будет дефолтное значение 2. :+ подставляет указанный текст, если переменная не пуста ${DEBUG:+--reload} Если что-то есть в переменной то распечатается текст после символа +, в противном случае - ничего. Удобно для опциональных флагов, как в нашем примере. Итого наш скрипт может выглядеть так: gunicorn --workers ${WORKER_COUNT:-2} \ --bind 0.0.0.0:8000 \ ${DEBUG:+--reload} main.wsgi Есть еще два оператора. := не только подставить дефолтное значение, но и присвоить его переменной, если она пуста # никаких переменных еще нет VAL1=${VAL2:=hello} # теперь доступны обе echo $VAL1 $VAL2 # hello hello :? остановить выполнение с ошибкой, если переменной нет. echo ${MISS:?is required} bash: MISS: is required Код выхода будет 1. #tricks#linux

Резултати

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

Пребарај: #quantization

当前筛选 #quantization清除筛选
GitHub Trends

@githubtrending · Post #14747 · 25.05.2025 г., 11:30

#python#deep_learning#intel#machine_learning#neural_network#pytorch#quantization Intel Extension for PyTorch boosts the speed of PyTorch on Intel hardware, including both CPUs and GPUs, by using special features like AVX-512, AMX, and XMX for faster calculations[5][2][4]. It supports many popular large language models (LLMs) such as Llama, Qwen, Phi, and DeepSeek, offering optimizations for different data types and easy GPU acceleration. This means you can run advanced AI models much faster and more efficiently on your Intel computer, with simple setup and support for both ready-made and custom models. https://github.com/intel/intel-extension-for-pytorch

GitHub Trends

@githubtrending · Post #15091 · 24.08.2025 г., 11:30

#python#comfyui#diffusion#flux#genai#mlsys#quantization Nunchaku is a fast and efficient engine that runs 4-bit neural networks using a special method called SVDQuant, which compresses models to use less memory and speed up processing by 2 to 5 times compared to older methods. It supports advanced AI models for tasks like high-quality text-to-image generation and image editing, working best on modern NVIDIA GPUs. You can easily install and use it with ComfyUI, and it has active community support on Slack, Discord, and WeChat. This means you can generate or edit images quickly with less computing power, saving time and resources. It also offers tutorials and example workflows to help you get started smoothly. https://github.com/nunchaku-tech/ComfyUI-nunchaku

GitHub Trends

@githubtrending · Post #15385 · 02.01.2026 г., 12:30

#python#deep_learning#inference#openai#quantization#speech_recognition#speech_to_text#transformer#whisper Faster-Whisper is a fast version of OpenAI's Whisper that transcribes audio up to 4x quicker with the same accuracy, using less memory on CPU or GPU—benchmarks show it beats original Whisper (e.g., 1m03s vs 2m23s for 13-min audio on GPU). Install via `pip install faster-whisper`, no FFmpeg needed, and use simple Python code like `WhisperModel("large-v3").transcribe("audio.mp3")` for segments with timestamps. You benefit by getting quick, efficient speech-to-text for real-time apps, saving time and resources on long files or batches. https://github.com/SYSTRAN/faster-whisper