Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ import numpy as np
|
|
6 |
# Carregar configuração
|
7 |
config = TimeSeriesTransformerConfig.from_pretrained("google/timesfm-2.0-500m-pytorch")
|
8 |
config.prediction_length = 3
|
9 |
-
config.context_length =
|
10 |
config.lags_sequence = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] # Lags menores que context_length
|
11 |
|
12 |
# Carregar modelo com a configuração ajustada
|
@@ -46,7 +46,7 @@ iface = gr.Interface(
|
|
46 |
inputs=gr.Textbox(label=f"Histórico de Vendas ({config.context_length} meses, separados por vírgulas)"),
|
47 |
outputs=gr.Textbox(label=f"Previsão para os Próximos {config.prediction_length} Meses"),
|
48 |
examples=[
|
49 |
-
["140,155,160,145,150,165,170,160,175,160,155,170,180"], #
|
50 |
],
|
51 |
cache_examples=False # Desativar cache para evitar erros
|
52 |
)
|
|
|
6 |
# Carregar configuração
|
7 |
config = TimeSeriesTransformerConfig.from_pretrained("google/timesfm-2.0-500m-pytorch")
|
8 |
config.prediction_length = 3
|
9 |
+
config.context_length = 20 # Aumentado para acomodar os lags
|
10 |
config.lags_sequence = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] # Lags menores que context_length
|
11 |
|
12 |
# Carregar modelo com a configuração ajustada
|
|
|
46 |
inputs=gr.Textbox(label=f"Histórico de Vendas ({config.context_length} meses, separados por vírgulas)"),
|
47 |
outputs=gr.Textbox(label=f"Previsão para os Próximos {config.prediction_length} Meses"),
|
48 |
examples=[
|
49 |
+
["140,155,160,145,150,165,170,160,175,160,155,170,180,190,200,210,220,230,240,250"], # 20 meses
|
50 |
],
|
51 |
cache_examples=False # Desativar cache para evitar erros
|
52 |
)
|