Commit
·
bcf9a43
1
Parent(s):
b0b5df0
Guardar mis cambios locales
Browse files
app.py
CHANGED
@@ -86,7 +86,7 @@ def get_converted_answer(table, query):
|
|
86 |
# Implement get_converted_answer function here...
|
87 |
pass
|
88 |
|
89 |
-
# Gradio Interface
|
90 |
def upload_and_forecast(uploaded_file, period):
|
91 |
if uploaded_file is None:
|
92 |
return "Please upload a file to proceed."
|
@@ -138,12 +138,12 @@ def upload_and_forecast(uploaded_file, period):
|
|
138 |
# Return the figures and growth data
|
139 |
return fig_compare, fig_forecast, future_sales_growth
|
140 |
|
141 |
-
# Gradio Interface setup
|
142 |
iface = gr.Interface(
|
143 |
fn=upload_and_forecast,
|
144 |
inputs=[
|
145 |
-
gr.File(label="Upload your sales data (CSV)"),
|
146 |
-
gr.Slider(minimum=30, maximum=90, step=1, label="Forecast Period (Days)")
|
147 |
],
|
148 |
outputs=[
|
149 |
gr.Plot(label="Historical vs Predicted Sales"),
|
@@ -151,6 +151,7 @@ iface = gr.Interface(
|
|
151 |
gr.DataFrame(label="Sales Growth")
|
152 |
],
|
153 |
live=True,
|
|
|
154 |
title="Sales Forecasting System",
|
155 |
description="Upload your sales data to start forecasting."
|
156 |
)
|
|
|
86 |
# Implement get_converted_answer function here...
|
87 |
pass
|
88 |
|
89 |
+
# Gradio Interface with updated design
|
90 |
def upload_and_forecast(uploaded_file, period):
|
91 |
if uploaded_file is None:
|
92 |
return "Please upload a file to proceed."
|
|
|
138 |
# Return the figures and growth data
|
139 |
return fig_compare, fig_forecast, future_sales_growth
|
140 |
|
141 |
+
# Gradio Interface setup with improved layout
|
142 |
iface = gr.Interface(
|
143 |
fn=upload_and_forecast,
|
144 |
inputs=[
|
145 |
+
gr.File(label="Upload your sales data (CSV)", elem_id="file-uploader"),
|
146 |
+
gr.Slider(minimum=30, maximum=90, step=1, label="Forecast Period (Days)", elem_id="forecast-period-slider")
|
147 |
],
|
148 |
outputs=[
|
149 |
gr.Plot(label="Historical vs Predicted Sales"),
|
|
|
151 |
gr.DataFrame(label="Sales Growth")
|
152 |
],
|
153 |
live=True,
|
154 |
+
theme="compact",
|
155 |
title="Sales Forecasting System",
|
156 |
description="Upload your sales data to start forecasting."
|
157 |
)
|