modernai commited on
Commit
e6823cd
·
verified ·
1 Parent(s): b5668d7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -28,14 +28,11 @@ with gr.Blocks() as demo:
28
  # This is the Current Recommended Portfolio Allocation
29
  """
30
  )
31
- total_funds_input = gr.Number("Type your total funds", elem_classes=["abc", "def"])
32
- submit_button = gr.Button("Submit", elem_id="btn")
33
- output = gr.Output() # Output component to capture the input value
34
-
35
  plot = gr.Plot(label="Portfolio Composition Chart")
36
- plot.change(create_portfolio_graph, inputs=[total_funds_input, submit_button], outputs=[output])
37
-
38
- demo.load(create_portfolio_graph, inputs=[total_funds_input, submit_button], outputs=[title, output, plot])
39
 
40
  if __name__ == "__main__":
41
  demo.launch()
 
28
  # This is the Current Recommended Portfolio Allocation
29
  """
30
  )
31
+ total_funds_input = gr.Number(value=0)
32
+ button = gr.Button("Submit", elem_id="btn",elem_classes=["abc", "def"])
 
 
33
  plot = gr.Plot(label="Portfolio Composition Chart")
34
+ button.change(create_portfolio_graph, inputs=button, outputs=[plot])
35
+ demo.load(create_portfolio_graph, inputs=[total_funds_input, button], outputs=[title, plot])
 
36
 
37
  if __name__ == "__main__":
38
  demo.launch()