środa, 31 stycznia 2024

Sztuczna inteligencja i Holokaust

Sztuczną inteligencję tak ktoś wytrenował (niemieckie pieniądze?), że słowo German/Germany praktycznie nie istnieje w odpowiedziach. A jak ktoś się upiera i namolnie pyta wprost ,,a Niemcy''? to AI uważa, że ,,The Holocaust ocurred in the context of Nazi Germany'' [cokolwiek to oznacza] oraz [nie pytany] dodaje, że po wojnie Niemcy przeszły taki proces że odrodzenie faszyzmu jest tam niemożliwe... [Powinno być chyba odrodzenie kontekstu?]

Fakt że molestowany później dawał już mądrzejsze odpowiedzi (ostatni screen)




wtorek, 2 stycznia 2024

Uploading photos with flickrapi

Extremly simple. To obtain api_key/api_secret one has to register. User authentication (obtaining auth_token/oauth_token_secret) is performed first time the script below is executed. The credentials are stored in ./flickr/oauth-tokens.sqlite.

I experienced an error sqlite3.OperationalError: no such table while using genuine flickrapi (ie installed from a Debian package). Installing via pip install fixed the problem. Also perms should be write not read as in a documentation (https://stuvel.eu/flickrapi-doc/3-auth.html#non-web-applications) Thats all...

#!/usr/bin/env python
#
# pip install flickrapi
#
# https://stuvel.eu/flickrapi-doc/4-uploading.html#flickr-upload
import flickrapi
import argparse

parser = argparse.ArgumentParser()
parser.add_argument("-p", type=str, help="picture")
parser.add_argument("-t", type=str, help="title")
parser.add_argument("-k", type=str, help="keywords")
args = parser.parse_args()
pic = args.p
pictitle = args.t
pickws = args.k

##

api_key=u'#########################'
api_secret=u'####################'

flickr = flickrapi.FlickrAPI(api_key, api_secret)
flickr.authenticate_via_browser(perms='write')
###################################### ^^^^^
###
flickr.upload(filename=pic, title=pictitle, tags=pickws)
###