hwang1 commited on
Commit
9fa02b2
·
verified ·
1 Parent(s): f2f89a2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -64,12 +64,11 @@ def plot_data(interest_rate_data, btc_prices):
64
  plt.close() # Close the plot to free up memory
65
  return fig
66
 
67
- @app.route('/plot')
68
- def get_plot():
69
  interest_rate_data, btc_prices = fetch_data()
70
- fig = plot_data(interest_rate_data, btc_prices)
71
- fig.savefig('plot.png')
72
- return send_file('plot.png', mimetype='image/png')
73
 
74
- if __name__ == '__main__':
75
- app.run(debug=True)
 
 
 
64
  plt.close() # Close the plot to free up memory
65
  return fig
66
 
67
+ def run_app():
 
68
  interest_rate_data, btc_prices = fetch_data()
69
+ return plot_data(interest_rate_data, btc_prices)
 
 
70
 
71
+ iface = gr.Interface(fn=run_app, inputs=[], outputs="plot", title="Financial Data Comparison", live=True)
72
+
73
+ if __name__ == "__main__":
74
+ iface.launch(share=True)