Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -36,9 +36,9 @@ def plot_anomalies(series, anomalies):
|
|
36 |
plt.show()
|
37 |
|
38 |
# Função para o Gradio
|
39 |
-
def anomaly_detection_app(
|
40 |
-
# Carregar a série temporal a partir do arquivo
|
41 |
-
df = pd.read_csv(
|
42 |
df['Date'] = pd.to_datetime(df['Date'])
|
43 |
df = df.set_index('Date')
|
44 |
|
@@ -53,10 +53,10 @@ def anomaly_detection_app(time_series_csv):
|
|
53 |
# Interface do Gradio
|
54 |
iface = gr.Interface(
|
55 |
fn=anomaly_detection_app,
|
56 |
-
inputs=gr.inputs.File(label="Carregar série temporal (
|
57 |
outputs="text",
|
58 |
title="Análise de Anomalias em Séries Temporais",
|
59 |
-
description="Este aplicativo detecta anomalias em uma série temporal carregada através de um arquivo
|
60 |
live=True
|
61 |
)
|
62 |
|
|
|
36 |
plt.show()
|
37 |
|
38 |
# Função para o Gradio
|
39 |
+
def anomaly_detection_app(time_series_txt):
|
40 |
+
# Carregar a série temporal a partir do arquivo de texto
|
41 |
+
df = pd.read_csv(time_series_txt, header=None, names=["Date", "Value"])
|
42 |
df['Date'] = pd.to_datetime(df['Date'])
|
43 |
df = df.set_index('Date')
|
44 |
|
|
|
53 |
# Interface do Gradio
|
54 |
iface = gr.Interface(
|
55 |
fn=anomaly_detection_app,
|
56 |
+
inputs=gr.inputs.File(label="Carregar série temporal (TXT)"),
|
57 |
outputs="text",
|
58 |
title="Análise de Anomalias em Séries Temporais",
|
59 |
+
description="Este aplicativo detecta anomalias em uma série temporal carregada através de um arquivo de texto (TXT).",
|
60 |
live=True
|
61 |
)
|
62 |
|