Spaces:
Runtime error
Runtime error
try getting creds as json
Browse files
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"]=
|
| 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"
|
| 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):
|