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

TGINSIGHT SIMILAR POSTS

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

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

reload_flag="" if [[ -n "${DEBUG}" ]]; then reload_flag="--reload" fi if [[ -n "${WORKER_COUNT}" ]]; then workers=${WORKER_COUNT} else workers=2 fi gunicorn --workers ${workers} \ --bind 0.0.0.0:8000 \ ${reload_flag} main.wsgi Писали такие конструкции чтобы проверить наличие флага и сформировать команду правильно? На самом деле можно сделать тоже самое проще. Для этого используются операторы условной подстановки, доступные в оболочках семейства POSIX. :- для установки значений по умолчанию ${WORKER_COUNT:-2} Если переменная не объявлена, то будет дефолтное значение 2. :+ подставляет указанный текст, если переменная не пуста ${DEBUG:+--reload} Если что-то есть в переменной то распечатается текст после символа +, в противном случае - ничего. Удобно для опциональных флагов, как в нашем примере. Итого наш скрипт может выглядеть так: gunicorn --workers ${WORKER_COUNT:-2} \ --bind 0.0.0.0:8000 \ ${DEBUG:+--reload} main.wsgi Есть еще два оператора. := не только подставить дефолтное значение, но и присвоить его переменной, если она пуста # никаких переменных еще нет VAL1=${VAL2:=hello} # теперь доступны обе echo $VAL1 $VAL2 # hello hello :? остановить выполнение с ошибкой, если переменной нет. echo ${MISS:?is required} bash: MISS: is required Код выхода будет 1. #tricks#linux

Резултати

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

Пребарај: #aioversight

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

@ai_and_law · Post #178 · 01.12.2023 г., 08:04

US: FTC Empowered in AI Oversight Move Hello, everybody! In a unanimous vote, the US Federal Trade Commission (FTC) has granted itself authority to demand documents in investigations of products and services claiming AI use. The decision allows the issuance of civil investigative demands (CIDs) during probes into corporate AI activities, streamlining the investigative process. This power, effective for a decade, aims to expedite investigations amid the growing role of AI in trade regulation cases. The FTC highlights the potential for AI to be misused for fraud, deception, privacy infringements, and unfair practices, necessitating robust oversight. As part of its heightened interest in AI, the FTC has initiated the "FTC Voice Cloning Challenge" to combat voice deepfakes. With a $25,000 prize for winning ideas, the challenge seeks multidisciplinary approaches to detect AI-generated audio. This move reflects the FTC's commitment to addressing the abuse of AI algorithms that mimic voices for fraudulent activities, such as unauthorized access to sensitive information or extortion scams. The challenge aims to encourage innovation while warning of potential regulatory actions if effective solutions don't emerge. #AIandLaw#FTC#AIOversight#VoiceCloningChallenge