Spaces:
Sleeping
Sleeping
Update streamlit_simulation/app.py
Browse files- streamlit_simulation/app.py +11 -2
streamlit_simulation/app.py
CHANGED
|
@@ -134,7 +134,11 @@ def load_transformer_model_and_dataset():
|
|
| 134 |
|
| 135 |
# Load model
|
| 136 |
model = load_moment_model()
|
| 137 |
-
checkpoint_path =
|
|
|
|
|
|
|
|
|
|
|
|
|
| 138 |
model.load_state_dict(torch.load(checkpoint_path, map_location=device))
|
| 139 |
model.to(device)
|
| 140 |
model.eval()
|
|
@@ -148,7 +152,12 @@ def load_transformer_model_and_dataset():
|
|
| 148 |
|
| 149 |
@st.cache_data
|
| 150 |
def load_data():
|
| 151 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 152 |
return df
|
| 153 |
|
| 154 |
|
|
|
|
| 134 |
|
| 135 |
# Load model
|
| 136 |
model = load_moment_model()
|
| 137 |
+
checkpoint_path = hf_hub_download(
|
| 138 |
+
repo_id="dlaj/energy-forecasting-files",
|
| 139 |
+
filename="transformer_model/model_final.pth",
|
| 140 |
+
repo_type="dataset"
|
| 141 |
+
)
|
| 142 |
model.load_state_dict(torch.load(checkpoint_path, map_location=device))
|
| 143 |
model.to(device)
|
| 144 |
model.eval()
|
|
|
|
| 152 |
|
| 153 |
@st.cache_data
|
| 154 |
def load_data():
|
| 155 |
+
csv_path = hf_hub_download(
|
| 156 |
+
repo_id="dlaj/energy-forecasting-files",
|
| 157 |
+
filename="data/processed/energy_consumption_aggregated_cleaned.csv",
|
| 158 |
+
repo_type="dataset"
|
| 159 |
+
)
|
| 160 |
+
df = pd.read_csv(csv_path, parse_dates=["date"])
|
| 161 |
return df
|
| 162 |
|
| 163 |
|