Spaces:
Sleeping
Sleeping
Commit Β·
a236840
1
Parent(s): 851a534
update 3
Browse files- app.py +3 -3
- requirements.txt +1 -1
app.py
CHANGED
|
@@ -13,7 +13,7 @@ from sklearn.metrics import mean_squared_error, mean_absolute_percentage_error
|
|
| 13 |
|
| 14 |
import joblib
|
| 15 |
from statsmodels.tsa.arima.model import ARIMA
|
| 16 |
-
|
| 17 |
|
| 18 |
# Prophet can be heavy; we load lazily inside functions to avoid slow import on startup
|
| 19 |
try:
|
|
@@ -49,7 +49,7 @@ series_close = df[["Close"]].copy()
|
|
| 49 |
# models
|
| 50 |
ARIMA_PATH = "models/arima_model.pkl"
|
| 51 |
PROPHET_PATH = "models/prophet_model.pkl"
|
| 52 |
-
LSTM_PATH = "models/lstm_model.
|
| 53 |
|
| 54 |
arima_model = None
|
| 55 |
prophet_model = None
|
|
@@ -72,7 +72,7 @@ if TENSORFLOW_AVAILABLE:
|
|
| 72 |
print("π Checking for LSTM model at:", LSTM_PATH)
|
| 73 |
if os.path.exists(LSTM_PATH):
|
| 74 |
try:
|
| 75 |
-
lstm_model =
|
| 76 |
print("β
LSTM model loaded successfully")
|
| 77 |
except Exception as e:
|
| 78 |
print("β LSTM load failed:", e)
|
|
|
|
| 13 |
|
| 14 |
import joblib
|
| 15 |
from statsmodels.tsa.arima.model import ARIMA
|
| 16 |
+
|
| 17 |
|
| 18 |
# Prophet can be heavy; we load lazily inside functions to avoid slow import on startup
|
| 19 |
try:
|
|
|
|
| 49 |
# models
|
| 50 |
ARIMA_PATH = "models/arima_model.pkl"
|
| 51 |
PROPHET_PATH = "models/prophet_model.pkl"
|
| 52 |
+
LSTM_PATH = "models/lstm_model.h5"
|
| 53 |
|
| 54 |
arima_model = None
|
| 55 |
prophet_model = None
|
|
|
|
| 72 |
print("π Checking for LSTM model at:", LSTM_PATH)
|
| 73 |
if os.path.exists(LSTM_PATH):
|
| 74 |
try:
|
| 75 |
+
lstm_model = load_model(LSTM_PATH, compile=False)
|
| 76 |
print("β
LSTM model loaded successfully")
|
| 77 |
except Exception as e:
|
| 78 |
print("β LSTM load failed:", e)
|
requirements.txt
CHANGED
|
@@ -11,4 +11,4 @@ joblib==1.4.2
|
|
| 11 |
tqdm==4.67.1
|
| 12 |
seaborn==0.12.2
|
| 13 |
plotly==5.24.0
|
| 14 |
-
tensorflow==2.
|
|
|
|
| 11 |
tqdm==4.67.1
|
| 12 |
seaborn==0.12.2
|
| 13 |
plotly==5.24.0
|
| 14 |
+
tensorflow-cpu==2.12.0
|