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

TGINSIGHT SIMILAR POSTS

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

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

Что делать если нужно поставить какую-то Python-библиотеку а root-прав нет? То есть в систему библиотеку никак и ничего не поставить. Есть как минимум два способа это решить правильно! 🔸 Сделать виртуальное окружение и ставить там что угодно. Это позволит создать полностью независимое исполняемое окружение для ваших приложений. Все библиотеки будут храниться в домашней директории юзера а значит доступ на запись имеется. Создать очень просто: python3 -m venv ~/venvs/myenvname Теперь активируем окружение # Linux source ~/venvs/myenvname/bin/activate # Windows %userprofile%\venvs\myenvname\Scripts\activate.bat Можно ставить любые библиотеки и запускать приложение. Это стандартный метод работы с любым проектом. Если еще не используете его, то пора начинать. Даже при наличии root доступа! 🔸 Бывает, что нет возможности запустить приложение из своего виртуального окружения. Например, его запускает какой-то сервис от вашего юзера и вставить активацию окружения вы не можете. В этом случае можно установить библиотеки для Python не глобально в систему, а только для юзера. Выполните этот код в консоли: python3 -m site Вы получите что-то такое: sys.path = [ '/home/user', '/usr/lib/python37.zip', '/usr/lib/python3.7', '/usr/lib/python3.7/lib-dynload', '/home/user/.local/lib/python3.7/site-packages', ... ] USER_BASE: '/home/user/.local' USER_SITE: '/home/user/.local/lib/python3.7/site-packages' ENABLE_USER_SITE: True Нас интересует параметр USER_SITE. Это путь к пользовательским библиотекам, которые доступны по умолчанию, если они есть. Именно сюда будут устанавливаться модули если добавить флаг --user при установке чего-либо через pip pip install --user requests Для этой команды не нужны root-права. После неё можно запускать системный интерпретатор без виртуальных окружений и установленная библиотека будет доступна для текущего юзера. Параметр USER_BASE показывает корневую директорию для хранения user-библиотек. Её можно изменить с помощью переменной окружения PYTHONUSERBASE export PYTHONUSERBASE=~/pylibs python3 -m site ... USER_BASE: '/home/user/pylibs' USER_SITE: '/home/user/pylibs/lib/python3.7/site-packages' Получается некоторое подобие виртуального окружения для бедных 😁 которое можно менять через эту переменную (не делайте так!Лучше venv!) 🔸 Дописывание пути в PYTHONPATH Этот способ не входит в список "двух правильных", но тоже рабочий. Здесь придётся сделать всё несколько сложней. Сначала ставим библиотеку в любое место указывая путь установки pip3 install -t ~/mylibs modulename Библиотека установится без привязки к какому-либо интерпретатору. То есть по умолчанию не будет видна. Теперь в нужный момент добавляем этот путь в sys.path или в PYTHONPATH. Не буду советовать так делать. Единственный раз когда этот способ мне пригодился и решил поставленную задачу, это при создании общей библиотеки для кластера компьютеров. Модули лежат в сети и подгружаются для всех из одного и того же места. То есть обновлять файлы требуется только один раз а не на всех хосты отдельно. Минусы такого подхода: ▫️Нужно всем хостам пробить нужный путь в .bashrc или ещё куда-то чтобы он сетапился на старте. ▫️Чем больше хостов тем больше нагрузка на сеть. Иногда такой способ не подходит именно по этой причине. Тогда Ansible вам в помощь. ▫️Не очень подходит если хосты с разными операционками. Некоторые библиотеки различаются для Linux и Windows (там, где есть бинарники) и приходится мудрить более сложные схемы. #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