IvanStudent commited on
Commit
e67bd82
ยท
1 Parent(s): 13ff6c0

Guardar mis cambios locales

Browse files
Files changed (1) hide show
  1. app.py +14 -5
app.py CHANGED
@@ -122,13 +122,22 @@ def upload_and_forecast(uploaded_file, period):
122
  # Return the figures and growth data
123
  return fig_compare, fig_forecast, future_sales_growth
124
 
125
- # Gradio Interface setup with external CSS file
 
 
 
 
 
 
 
 
 
 
 
 
126
  iface = gr.Interface(
127
  fn=upload_and_forecast,
128
- inputs=[
129
- gr.File(label="๐Ÿ“‚ Upload your sales data (CSV)", elem_id="file-uploader"),
130
- gr.Slider(minimum=30, maximum=90, step=1, label="โณ Forecast Period (Days)", elem_id="forecast-period-slider")
131
- ],
132
  outputs=[
133
  gr.Plot(label="๐Ÿ“ˆ Historical vs Predicted Sales"),
134
  gr.Plot(label="๐Ÿ”ฎ Forecasted Sales Data"),
 
122
  # Return the figures and growth data
123
  return fig_compare, fig_forecast, future_sales_growth
124
 
125
+ # Gradio Interface setup with external CSS file and sidebar
126
+ def create_sidebar():
127
+ with gr.Sidebar():
128
+ gr.Markdown("### ๐Ÿ“‚ Upload your sales data (CSV)")
129
+ uploaded_file = gr.File(label="Choose your file", elem_id="file-uploader")
130
+ gr.Markdown("### โณ Forecast Period (Days)")
131
+ period = gr.Slider(minimum=30, maximum=90, step=1, label="Forecast period (in days)")
132
+ return uploaded_file, period
133
+
134
+ # Create the sidebar and main interface
135
+ uploaded_file, period = create_sidebar()
136
+
137
+ # Gradio interface for main content
138
  iface = gr.Interface(
139
  fn=upload_and_forecast,
140
+ inputs=[uploaded_file, period],
 
 
 
141
  outputs=[
142
  gr.Plot(label="๐Ÿ“ˆ Historical vs Predicted Sales"),
143
  gr.Plot(label="๐Ÿ”ฎ Forecasted Sales Data"),