multimodalart HF Staff commited on
Commit
5dd892a
·
verified ·
1 Parent(s): f954275

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -109,9 +109,11 @@ def forecast(
109
 
110
  freq_str, domain = FREQ_MAP.get(freq_choice, ("H", "Energy"))
111
 
112
- # Build gluonts-style entry
 
 
113
  try:
114
- start = pd.Period("2020-01-01", freq=freq_str)
115
  except Exception:
116
  start = pd.Period("2020-01-01", freq="D")
117
 
 
109
 
110
  freq_str, domain = FREQ_MAP.get(freq_choice, ("H", "Energy"))
111
 
112
+ # Build gluonts-style entry. pandas prefers lowercase freq for Period,
113
+ # but the model's seasonal_scale_factor expects uppercase (e.g. "H", "D").
114
+ _period_freq = freq_str.lower() if freq_str.upper() == freq_str else freq_str
115
  try:
116
+ start = pd.Period("2020-01-01", freq=_period_freq)
117
  except Exception:
118
  start = pd.Period("2020-01-01", freq="D")
119