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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #205 · 22 јан.

Как работает функция reload()? Эта функция нужна для того, чтобы перезагрузить изменившийся код из py-файла без рестарта интерпретатора. Дело в том, что любой импортированный модуль при повторном импорте не будет перечитывать файл. Функция импорта вернёт уже загруженный в память объект модуля. Чтобы обновить код, нужно либо перезапустить всю программу, либо использовать функцию reload() from importlib import reload reload(my_module) 🔸 Функция reload() принимает в качестве аргумента только объект модуля или пакета. Она не может перезагрузить класс или функцию. Только весь файл целиком! 🔸 Перезагрузка пакета перезагрузит только его файл __init__.py, если он есть. Но не вложенные модули. 🔸Она не может перезагрузить ранее не импортированный модуль. 🔸При вызове функция reload() перечитывает и перекомпилирует код в файле, создавая новые объекты. После создания новых объектов перезаписывается ранее созданный неймспейс этого модуля. Это значит, что если где-то этот модуль импортирован через import и обращение к атрибутам происходит через неймспейс (имя) модуля, то такие атрибуты обновятся. Если какие-либо объекты из этого модуля импортированы через from то они будут ссылаться на старые объекты. Напишем простой модуль # mymodule.py x = 1 Теперь импортируем модуль и отдельно переменную х из модуля >>> import mymodule >>> from mymodule import x >>> print(mymodule.x) 1 >>> print(x) 1 Не перезапуская интерпретатор вносим изменения в модуль # mymodule.py x = 2 Делаем перезагрузку модуля и проверяем х ещё раз >>> reload(mymodule) >>> print(mymodule.x) 2 >>> print(x) 1 То же самое будет если присвоить любой объект переменной (даже словарь или список) Повторный импорт обновляет значение >>> from mymodule import x >>> print(x) 2 🔸Созданные инстансы классов не обновятся после перезагрузки модуля. Их придётся пересоздать. #tricks#basic

Резултати

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

Пребарај: #aitraining

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

@ai_and_law · Post #569 · 14.05.2025 г., 07:04

🇬🇧UK Artists Demand AI Transparency in Copyright Use More than 400 British artists — including Elton John, Dua Lipa, Coldplay, and Paul McCartney — have signed an open letter urging Prime Minister Keir Starmer to support legislation that would mandate transparency in the use of copyrighted materials for AI training. The letter emphasizes that creative copyright is not just a legal tool but “the lifeblood of the creative industries,” underpinning both moral ownership and economic sustainability for millions. #AI#Copyright#AITraining

AI & Law

@ai_and_law · Post #443 · 14.11.2024 г., 08:04

Copyright Claims on AI Training Dismissed: A Case of Harm and Fair Use A recent New York court decision has set a notable precedent in copyright disputes involving AI training. Judge Colleen McMahon dismissed a lawsuit against OpenAI from news outlets Raw Story and AlterNet, which alleged the unauthorized use of their content to train ChatGPT. The case was dismissed on the grounds that the plaintiffs could not sufficiently demonstrate harm. However, Judge McMahon allowed room for an amended complaint, though she expressed doubt over whether the outlets could establish a recognizable injury under current law. OpenAI maintains that their model training practices align with fair use principles, as they rely on publicly accessible data and established legal precedents. Raw Story and AlterNet are evaluating options for amendment, emphasizing their confidence in addressing the court's concerns. The decision brings to light complex questions on fair use and copyright harm, particularly as AI tools continue to evolve and reshape content creation. #Copyright#AITraining#FairUse#AIRegulation

Crypto M - Crypto News

@CryptoM · Post #65290 · 12.04.2026 г., 14:54

🚀 AI TRENDS | Moore Threads Completes Rapid Adaptation of MTT S5000 GPU for MiniMax M2.7 Moore Threads has announced the successful completion of the Day-0 rapid adaptation of its flagship AI training and inference all-in-one GPU, the MTT S5000, for the new generation large model, MiniMax M2.7. According to Odaily, this achievement further demonstrates the capability of domestically produced full-feature GPUs to quickly respond to and support cutting-edge AI models. #MooreThreads#MTTS5000#AItraining#GPU#MiniMaxM2.7 #AImodels#domesticGPU

EdgeMarket.AI 📣

@edgemarketai · Post #8086 · 31.03.2026 г., 11:54

The next layer of EdgeMarket is live. We’re introducing community validation for real world events feeding verified truth directly into AI systems. Every validation strengthens the network. Every correct signal earns rewards. ⚡ Validate events 🧠. Train AI with real data 💰 Earn $BET This is how decentralised intelligence is built. Signal Truth. Earn $BET Click Here ⬇️ To Start https://edgemarket.ai/bnb/validate-results #EdgeMarket#AI#Web3#Crypto#BET #Airdrop#EarnCrypto#SignalTruth#Validation #Decentralization#AITraining#Blockchain #CommunityDriven#OnChain#DePIN