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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #60 · 31 мар.

Вторая по частоте future-функция, которую я использовал, это абсолютный импорт from __future__ import absolute_import Что она делает? Изменения, которые вносит эта инъекция описаны в PEP328 Покажу простой пример. Допустим, есть такой пакет: /my_package /__init__.py /main.py /string.py Смотрим код в my_package/main.py # main.py import string Простой пример готов) Вопрос в том, какой модуль импортируется в данном случае? Есть два варианта: 1. модуль в моём пакете my_package.string 2. стандартный модуль string И вот тут вступает в дело приоритет импортов. В Python2 порядок следующий: помимо иных источников, раньше ищется модуль внутри текущего пакета, а потом в стандартных библиотеках. Таким образом мы импортнём my_package.string. Но в Python3 это поведение изменилось. Если мы указываем просто имя пакета, то ищется именно такой модуль, игнорируя имена в текущем пакете. Если мы хотим импортнуть именно подмодуль из нашего пакета то, мы должны теперь явно это указывать. from my_package import string или относительный импорт, но с указанием пути относительно текущего модуля main from . import string Еще одной неоднозначностью меньше 😎 Подробней про импорты здесь: https://docs.python.org/3/tutorial/modules.html #2to3#pep#basic

Резултати

Пронајдени 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