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

Резултати

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

Пребарај: #copyrightlawsuit

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

@ai_and_law · Post #174 · 27.11.2023 г., 08:04

OpenAI Faces Fifth Copyright Lawsuit Over AI Models Greetings AI & Law Community! OpenAI finds itself entangled in a fifth copyright lawsuit, with Microsoft also implicated. Filed by US writer Julian Sancton, the lawsuit alleges a blatant disregard for copyrights in training AI models, specifically ChatGPT. Julian Sancton, a New York Times best-selling author, spent five years and extensive resources researching and writing "Madhouse at the End of the Earth." This lawsuit represents him and other writers who feel their work has been misused. The crux of the matter is OpenAI and Microsoft using copyrighted works without compensating or seeking permission from authors. The lawsuit contends that these companies not only reproduced millions of works but also built a model that mimics the style and themes of these copyrighted materials. Unlike previous lawsuits against OpenAI, this one includes Microsoft as a defendant. The claim suggests a close collaboration between the two companies in creating and monetizing AI models like GPT-3 and GPT-4, which underpin various Microsoft services. The plaintiffs demand compensation for their work and seek a court order prohibiting OpenAI and Microsoft from training their models by infringing on copyrighted material. This marks the fifth lawsuit against OpenAI by writers, emphasizing a growing legal concern within the AI community. #AILaw#CopyrightLawsuit#OpenAI#Microsoft#AICommunity

AI & Law

@ai_and_law · Post #273 · 29.03.2024 г., 08:04

Bloomberg Asserts Fair Use Defense in AI Copyright Lawsuit Bloomberg LP has moved to dismiss a lawsuit from Arkansas governor Mike Huckabee and other authors, arguing that its use of copyrighted works for AI research falls within the bounds of fair use. The authors, including best-selling Christian writer Lysa TerKeurst, allege that Bloomberg misused their books to train its AI system without permission. Bloomberg contends that the authors' claims lack specificity regarding infringement and which books were utilized for BloombergGPT, describing the system as an internal research project. In its filing, Bloomberg emphasized that its use of copyrighted material was limited, private, and not for commercial purposes, asserting that such use does not constitute copyright infringement. The lawsuit is part of a broader trend where copyright holders challenge tech companies over alleged misuse of content for training AI models. Bloomberg's fair use defense is expected to be pivotal in this dispute. #Bloomberg#CopyrightLawsuit#FairUse#AIResearch

AI & Law

@ai_and_law · Post #161 · 10.11.2023 г., 08:04

Artist Lawsuit Over AI Image Generators Faces Challenges Hello, dear subscribers! In the ongoing lawsuit against AI image generators by artists, several claims were dismissed by US district Judge William H. Orrick. Notably, two of the three plaintiffs in the case had not registered their disputed works with the Copyright Office, leading to the dismissal of their claims. However, the lead plaintiff, Sarah Andersen, has 30 days to amend her complaint and continue the copyright dispute. The artists allege that AI image generators infringe on their copyrights, claiming direct and vicarious infringement, violations of the Digital Millennium Copyright Act, and California laws related to unfair competition and rights to publicity. They argue that AI-generated images should be considered derivative works based on copyrighted content. While the case proceeds, the judge has called for clarification on how image generators work, especially regarding "compressed copies" of images and the operation of AI systems like Stable Diffusion. The lawsuit remains complex, with the core claim of direct copyright infringement proceeding against Stability AI but not against DeviantArt and Midjourney. The artists will need to address the many issues identified in their claims, including specifics regarding copyright management information and rights of publicity. #AIImageGenerators#CopyrightLawsuit#AIandArt#LegalAction