Spaces:
Sleeping
Sleeping
added things
Browse files
app.py
CHANGED
|
@@ -23,6 +23,8 @@ def dataProcessing(file, timestamp_column:str=None):
|
|
| 23 |
df = assembleResults(preProcessedData, timestamp_old, target_cols, scores)
|
| 24 |
|
| 25 |
fig = plotResults(df, target_cols)
|
|
|
|
|
|
|
| 26 |
|
| 27 |
df.to_csv(OUT_PATH, index=False)
|
| 28 |
|
|
@@ -70,7 +72,7 @@ with gr.Blocks(title="Time series anomaly detection with Chronos2") as demo:
|
|
| 70 |
)
|
| 71 |
|
| 72 |
with gr.Row():
|
| 73 |
-
with gr.Column(scale=
|
| 74 |
file_input = gr.File(label="Upload Time Series Data (CSV)", file_types=[".csv"], file_count="single", )
|
| 75 |
timestamp_question = gr.Radio(
|
| 76 |
label="Does your data contain a timestamp column?",
|
|
@@ -89,7 +91,7 @@ with gr.Blocks(title="Time series anomaly detection with Chronos2") as demo:
|
|
| 89 |
|
| 90 |
detect_button = gr.Button("Detect Anomalies")
|
| 91 |
|
| 92 |
-
with gr.Column(scale=
|
| 93 |
plot_output = gr.Plot(label="Time Series with Detected Anomalies", visible=False)
|
| 94 |
download_output = gr.File(label="Download Anomaly Detection Results (CSV)", visible=False, interactive=False)
|
| 95 |
errorHandler = gr.Markdown(label="Error Messages", visible=False)
|
|
@@ -98,7 +100,6 @@ with gr.Blocks(title="Time series anomaly detection with Chronos2") as demo:
|
|
| 98 |
lambda file, timestamp_question, timestamp_column: dataProcessing(file, timestamp_column if timestamp_question == "Yes" else None),
|
| 99 |
inputs=[file_input, timestamp_question, timestamp_column_input],
|
| 100 |
outputs=[plot_output, download_output, errorHandler],
|
| 101 |
-
show_progress=True
|
| 102 |
)
|
| 103 |
|
| 104 |
|
|
|
|
| 23 |
df = assembleResults(preProcessedData, timestamp_old, target_cols, scores)
|
| 24 |
|
| 25 |
fig = plotResults(df, target_cols)
|
| 26 |
+
|
| 27 |
+
raise Exception("Pizza alla Nutella.")
|
| 28 |
|
| 29 |
df.to_csv(OUT_PATH, index=False)
|
| 30 |
|
|
|
|
| 72 |
)
|
| 73 |
|
| 74 |
with gr.Row():
|
| 75 |
+
with gr.Column(scale=1):
|
| 76 |
file_input = gr.File(label="Upload Time Series Data (CSV)", file_types=[".csv"], file_count="single", )
|
| 77 |
timestamp_question = gr.Radio(
|
| 78 |
label="Does your data contain a timestamp column?",
|
|
|
|
| 91 |
|
| 92 |
detect_button = gr.Button("Detect Anomalies")
|
| 93 |
|
| 94 |
+
with gr.Column(scale=4):
|
| 95 |
plot_output = gr.Plot(label="Time Series with Detected Anomalies", visible=False)
|
| 96 |
download_output = gr.File(label="Download Anomaly Detection Results (CSV)", visible=False, interactive=False)
|
| 97 |
errorHandler = gr.Markdown(label="Error Messages", visible=False)
|
|
|
|
| 100 |
lambda file, timestamp_question, timestamp_column: dataProcessing(file, timestamp_column if timestamp_question == "Yes" else None),
|
| 101 |
inputs=[file_input, timestamp_question, timestamp_column_input],
|
| 102 |
outputs=[plot_output, download_output, errorHandler],
|
|
|
|
| 103 |
)
|
| 104 |
|
| 105 |
|