heaversm commited on
Commit
7a2e70c
·
1 Parent(s): 044bd10

try getting creds as json

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -72,8 +72,12 @@ def get_credentials():
72
  temp.write(creds_json_str) # write in json format
73
  temp_filename = temp.name
74
  return temp_filename
 
 
 
 
75
  # pass
76
- os.environ["GOOGLE_APPLICATION_CREDENTIALS"]= get_credentials()
77
 
78
  # pick a random challenge
79
  def get_challenge():
@@ -216,7 +220,7 @@ with gr.Blocks(css=css) as demo:
216
 
217
  gr.Markdown("# <center>Prompt de Resistance Vertex Imagen</center>")
218
 
219
- pw = gr.Textbox(label="Password", type="password", placeholder="Enter the password to unlock the service", value="REBEL.pier6moment")
220
 
221
  #instructions
222
  with gr.Accordion("Instructions & Tips",label="instructions",open=False):
 
72
  temp.write(creds_json_str) # write in json format
73
  temp_filename = temp.name
74
  return temp_filename
75
+ def get_creds_json():
76
+ creds_json_str = os.getenv("IMAGEN")
77
+ return json.loads(creds_json_str)
78
+
79
  # pass
80
+ os.environ["GOOGLE_APPLICATION_CREDENTIALS"]= get_creds_json()
81
 
82
  # pick a random challenge
83
  def get_challenge():
 
220
 
221
  gr.Markdown("# <center>Prompt de Resistance Vertex Imagen</center>")
222
 
223
+ pw = gr.Textbox(label="Password", type="password", placeholder="Enter the password to unlock the service")
224
 
225
  #instructions
226
  with gr.Accordion("Instructions & Tips",label="instructions",open=False):