Spaces:
Runtime error
Runtime error
try different auth method
Browse filesFiles changed (2)
- app.py+11-2
- requirements.txt+3-1
33 unmodified lines3435363737383940414236 unmodified lines79808182838485808687888990919233 unmodified lines# GCP credentials stuffimport jsonimport tempfile
import pybase64from google.oauth2 import service_accountimport google.auth
load_dotenv()
36 unmodified lines return 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()#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 lines34566782 unmodified linespython-dotenv==1.0.0pymongogoogle-cloud-aiplatform>=1.38pillow==10.2.0pillow==10.2.0google==3.0.0pybase64==1.3.2app.py+11-2
requirements.txt+3-1