vilarin commited on
Commit
0c91b75
1 Parent(s): 6edbf4e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -108,7 +108,8 @@ def setAccount(token, accountId):
108
  ACCOUNT_ID = accountId
109
 
110
  def gen(prompt: str, system_prompt: str, token: str, accountId: str):
111
- setAccount(token, accountId)
 
112
  text = generate_text(prompt, system_prompt)
113
  image = generate_image(str(text))
114
  text = f"Prompt: {prompt}\n\nOptimized Prompt: {text}"
@@ -123,7 +124,7 @@ with gr.Blocks(theme="ocean") as demo:
123
  clearBtn = gr.ClearButton([prompt])
124
  gen_text = gr.Textbox(label="Optimization")
125
  gen_img = gr.Image(type="pil", label='Generated Image', height=600)
126
- with gr.Accordion("Advanced Options", open=False):
127
  system_prompt = gr.Textbox(
128
  value = PRESET_PROMPT,
129
  label = "System prompt",
 
108
  ACCOUNT_ID = accountId
109
 
110
  def gen(prompt: str, system_prompt: str, token: str, accountId: str):
111
+ if token and accountId:
112
+ setAccount(token, accountId)
113
  text = generate_text(prompt, system_prompt)
114
  image = generate_image(str(text))
115
  text = f"Prompt: {prompt}\n\nOptimized Prompt: {text}"
 
124
  clearBtn = gr.ClearButton([prompt])
125
  gen_text = gr.Textbox(label="Optimization")
126
  gen_img = gr.Image(type="pil", label='Generated Image', height=600)
127
+ with gr.Accordion("Advanced Options", open=True):
128
  system_prompt = gr.Textbox(
129
  value = PRESET_PROMPT,
130
  label = "System prompt",