Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -71,10 +71,10 @@ def get_databricks_file(file_path):
|
|
| 71 |
def get_month_label(i):
|
| 72 |
return f'M{i+1}'
|
| 73 |
|
| 74 |
-
data_predictions_ = get_databricks_file("dbfs:/dbfs/FileStore/forecast_alleviatetax_predictions.csv")
|
| 75 |
-
df = pd.read_csv(StringIO(data_predictions_.decode('utf-8')))
|
| 76 |
-
df['revenue'] = (df['vintage_unique_cases'] / df['predicted_monthly_payment_rate']).round(2)
|
| 77 |
-
df['Month'] = [get_month_label(i) for i in range(len(df))]
|
| 78 |
|
| 79 |
def update_table(start_date, end_date, window, user_text):
|
| 80 |
#############################################################################################
|
|
@@ -169,7 +169,8 @@ with gr.Blocks(fill_height=True) as demo:
|
|
| 169 |
prediction_input = gr.Text(label="Month Prediction:", placeholder="Enter date (e.g., 2024-10-31)", max_lines=1)
|
| 170 |
range_input = gr.Slider(1, 10, 6, label="Window / Moving Average Period")
|
| 171 |
|
| 172 |
-
table_ = gr.DataFrame(value=df, label="Predictions (consult 'revenue' column):")
|
|
|
|
| 173 |
btn_update = gr.Button("Run Forecast")
|
| 174 |
|
| 175 |
#with gr.Row():
|
|
|
|
| 71 |
def get_month_label(i):
|
| 72 |
return f'M{i+1}'
|
| 73 |
|
| 74 |
+
#data_predictions_ = get_databricks_file("dbfs:/dbfs/FileStore/forecast_alleviatetax_predictions.csv")
|
| 75 |
+
#df = pd.read_csv(StringIO(data_predictions_.decode('utf-8')))
|
| 76 |
+
#df['revenue'] = (df['vintage_unique_cases'] / df['predicted_monthly_payment_rate']).round(2)
|
| 77 |
+
#df['Month'] = [get_month_label(i) for i in range(len(df))]
|
| 78 |
|
| 79 |
def update_table(start_date, end_date, window, user_text):
|
| 80 |
#############################################################################################
|
|
|
|
| 169 |
prediction_input = gr.Text(label="Month Prediction:", placeholder="Enter date (e.g., 2024-10-31)", max_lines=1)
|
| 170 |
range_input = gr.Slider(1, 10, 6, label="Window / Moving Average Period")
|
| 171 |
|
| 172 |
+
#table_ = gr.DataFrame(value=df, label="Predictions (consult 'revenue' column):")
|
| 173 |
+
table_ = gr.DataFrame(value='', label="Predictions (consult 'revenue' column):")
|
| 174 |
btn_update = gr.Button("Run Forecast")
|
| 175 |
|
| 176 |
#with gr.Row():
|