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

Резултати

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

Пребарај: #faiss

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

@githubtrending · Post #15295 · 11.11.2025 г., 17:00

#python#ai#faiss#gpt_oss#langchain#llama_index#llm#localstorage#offline_first#ollama#privacy#python#rag#retrieval_augmented_generation#vector_database#vector_search#vectors LEANN is a tiny, powerful vector database that lets you turn your laptop into a personal AI assistant capable of searching millions of documents using 97% less storage than traditional systems without losing accuracy. It works by storing a compact graph and computing embeddings only when needed, saving huge space and keeping your data private on your device. You can search your files, emails, browser history, chat logs, live data from platforms like Slack and Twitter, and even codebases—all locally without cloud costs. This means fast, private, and efficient AI-powered search and retrieval on your own laptop. https://github.com/yichuan-w/LEANN

GitHub Trends

@githubtrending · Post #15168 · 25.09.2025 г., 12:30

#python#ai#context#embedded#faiss#knowledge_base#knowledge_graph#llm#machine_learning#memory#nlp#offline_first#opencv#python#rag#retrieval_augmented_generation#semantic_search#vector_database#video_processing Memvid lets you store millions of text pieces inside a single MP4 video file using QR codes, making your data 50-100 times smaller than usual databases. You can search this video instantly in under 100 milliseconds without needing servers or internet after setup. It works offline, is easy to use with simple Python code, and supports PDFs and chat with your data. The upcoming version 2 will add features like continuous memory updates, shareable capsules, fast local caching, and better video compression, making your AI memory smarter, faster, and more flexible. This means you get a powerful, portable, and efficient way to manage and search huge knowledge bases quickly and easily. https://github.com/Olow304/memvid