Spaces:
Runtime error
Runtime error
try different auth method
Browse filesFiles changed (2)
- app.py+11-2
- requirements.txt+3-1
33 unmodified lines3435363738394036 unmodified lines7778798081828333 unmodified lines# GCP credentials stuffimport jsonimport tempfileload_dotenv()36 unmodified linesreturn json.loads(creds_json_str)# passos.environ["GOOGLE_APPLICATION_CREDENTIALS"]= get_creds_json()# pick a random challengedef get_challenge():33 unmodified lines34353637383940414236 unmodified lines798081828384858687888990919233 unmodified lines# GCP credentials stuffimport jsonimport tempfileimport pybase64from google.oauth2 import service_accountimport google.authload_dotenv()36 unmodified linesreturn json.loads(creds_json_str)# pass# service_acct_json = open(pdr-imagen-encoded.json')service_account_json = pybase64.b64decode(os.getenv("IMAGEN"))service_account_info = json.loads(service_account_json)credentials = service_account.Credentials.from_service_account_info(service_account_info)#os.environ["GOOGLE_APPLICATION_CREDENTIALS"]= get_creds_json()project="pdr-imagen"aiplatform.init(project=project, credentials=credentials)# pick a random challengedef get_challenge():
2 unmodified lines34562 unmodified linespython-dotenv==1.0.0pymongogoogle-cloud-aiplatform>=1.38pillow==10.2.02 unmodified lines3456782 unmodified linespython-dotenv==1.0.0pymongogoogle-cloud-aiplatform>=1.38pillow==10.2.0google==3.0.0pybase64==1.3.2
app.py+11-2
requirements.txt+3-1