sohoso commited on
Commit
38d535f
·
verified ·
1 Parent(s): b25a00a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -142,10 +142,10 @@ app = gr.Interface(
142
  fn=ImageChat,
143
  inputs=[
144
  gr.Image(label="Image"),
145
- gr.Dropdown(label="Chart Type", choices=["Forex", "Crypto", "Stocks"], type="value", default="Stocks"),
146
  gr.Textbox(label="Ticker", placeholder="Enter ticker symbol"),
147
  gr.Textbox(label="Prompt", value="Analyze"),
148
- gr.Dropdown(label="Analyze more", choices=[], type="value", placeholder="Select a question", dynamic=True)
149
  ],
150
  outputs=gr.Textbox(label="Response"),
151
  title="Trading View Chat Analyzer",
@@ -153,7 +153,7 @@ app = gr.Interface(
153
  )
154
 
155
  # Dynamically update the questions based on the chart type
156
- @app.change(inputs=["Chart Type"], outputs=["Analyze more"])
157
  def update_analyze_more(chart_type):
158
  return gr.Dropdown.update(choices=populate_questions(chart_type))
159
 
 
142
  fn=ImageChat,
143
  inputs=[
144
  gr.Image(label="Image"),
145
+ gr.Dropdown(label="Chart Type", choices=["Forex", "Crypto", "Stocks"], type="value", value="Stocks"),
146
  gr.Textbox(label="Ticker", placeholder="Enter ticker symbol"),
147
  gr.Textbox(label="Prompt", value="Analyze"),
148
+ gr.Dropdown(label="Analyze more", choices=[], type="value", placeholder="Select a question", interactive=True)
149
  ],
150
  outputs=gr.Textbox(label="Response"),
151
  title="Trading View Chat Analyzer",
 
153
  )
154
 
155
  # Dynamically update the questions based on the chart type
156
+ @app.change(inputs="Chart Type", outputs="Analyze more")
157
  def update_analyze_more(chart_type):
158
  return gr.Dropdown.update(choices=populate_questions(chart_type))
159