Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -173,7 +173,7 @@ with gr.Blocks(fill_height=True) as demo:
|
|
| 173 |
btn_2.click(hide_and_show_panel, outputs=[panel_2, panel_1, user_text, input_text]) # Hide Panel 2 and show Panel 1
|
| 174 |
with gr.Row():
|
| 175 |
with gr.Column():
|
| 176 |
-
start_input = gr.Textbox(label="Start Date:", placeholder="Enter date (e.g., 2023-09-01)", max_lines=1)
|
| 177 |
gr.Markdown("Start of the data range of months that will be used as input by the model for revenue prediction.<br><br>The end month is automatically set to one month before the prediction month.")
|
| 178 |
with gr.Column():
|
| 179 |
prediction_input = gr.Text(label="Month Prediction:", placeholder="Enter date (e.g., 2024-10-31)", max_lines=1)
|
|
@@ -181,17 +181,18 @@ with gr.Blocks(fill_height=True) as demo:
|
|
| 181 |
with gr.Column():
|
| 182 |
range_input = gr.Slider(3, 12, 6, label="Window / Moving Average Period")
|
| 183 |
gr.Markdown("Window = 3-period/months, the predictive model reacts more quickly to recent monthly payment fluctuations, but it may also include more noise.<br><br>Window = 12-period/months, the Forecast adjusts more slowly and is less sensitive to small fluctuations, making it more reliable, but also slower to react to sharp changes.")
|
| 184 |
-
|
| 185 |
-
table_1 = gr.DataFrame(value=df, label="Predictions (consult 'revenue' column):")
|
| 186 |
btn_update = gr.Button("Run Forecast")
|
| 187 |
-
|
|
|
|
|
|
|
| 188 |
#table_2 = gr.DataFrame(value=df_2, label="Forecast Inputs:")
|
| 189 |
btn_update.click(fn=update_table, inputs=[start_input, prediction_input, range_input, user_text], outputs=[table_1#,table_2
|
| 190 |
])
|
| 191 |
|
| 192 |
-
|
| 193 |
# Configure the buttons and the panel visibility
|
| 194 |
btn_1.click(check_words, inputs=[user_text, input_text], outputs=[panel_2, panel_1])
|
| 195 |
|
| 196 |
demo.launch()
|
| 197 |
|
|
|
|
|
|
|
|
|
| 173 |
btn_2.click(hide_and_show_panel, outputs=[panel_2, panel_1, user_text, input_text]) # Hide Panel 2 and show Panel 1
|
| 174 |
with gr.Row():
|
| 175 |
with gr.Column():
|
| 176 |
+
start_input = gr.Textbox(label="Start Date:", value= '2023-09-01', placeholder="Enter date (e.g., 2023-09-01)", max_lines=1)
|
| 177 |
gr.Markdown("Start of the data range of months that will be used as input by the model for revenue prediction.<br><br>The end month is automatically set to one month before the prediction month.")
|
| 178 |
with gr.Column():
|
| 179 |
prediction_input = gr.Text(label="Month Prediction:", placeholder="Enter date (e.g., 2024-10-31)", max_lines=1)
|
|
|
|
| 181 |
with gr.Column():
|
| 182 |
range_input = gr.Slider(3, 12, 6, label="Window / Moving Average Period")
|
| 183 |
gr.Markdown("Window = 3-period/months, the predictive model reacts more quickly to recent monthly payment fluctuations, but it may also include more noise.<br><br>Window = 12-period/months, the Forecast adjusts more slowly and is less sensitive to small fluctuations, making it more reliable, but also slower to react to sharp changes.")
|
|
|
|
|
|
|
| 184 |
btn_update = gr.Button("Run Forecast")
|
| 185 |
+
gr.HTML(f"<h2>Predictions</h>")
|
| 186 |
+
gr.Markdown("It's recommended to make the prediction once the selected month has passed.")
|
| 187 |
+
table_1 = gr.DataFrame(value=df, label="Predictions (consult 'revenue' column):")
|
| 188 |
#table_2 = gr.DataFrame(value=df_2, label="Forecast Inputs:")
|
| 189 |
btn_update.click(fn=update_table, inputs=[start_input, prediction_input, range_input, user_text], outputs=[table_1#,table_2
|
| 190 |
])
|
| 191 |
|
|
|
|
| 192 |
# Configure the buttons and the panel visibility
|
| 193 |
btn_1.click(check_words, inputs=[user_text, input_text], outputs=[panel_2, panel_1])
|
| 194 |
|
| 195 |
demo.launch()
|
| 196 |
|
| 197 |
+
|
| 198 |
+
|