Spaces:
Sleeping
Sleeping
Commit Β·
73523bb
1
Parent(s): 8a13c49
update new model
Browse files
app.py
CHANGED
|
@@ -68,16 +68,14 @@ if PROPHET_AVAILABLE and os.path.exists(PROPHET_PATH):
|
|
| 68 |
|
| 69 |
if TENSORFLOW_AVAILABLE and os.path.exists(LSTM_PATH):
|
| 70 |
print("β
TensorFlow imported successfully")
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
else:
|
| 80 |
-
print("β LSTM model file not found at", LSTM_PATH)
|
| 81 |
|
| 82 |
# ----------------------------
|
| 83 |
# Helpers
|
|
|
|
| 68 |
|
| 69 |
if TENSORFLOW_AVAILABLE and os.path.exists(LSTM_PATH):
|
| 70 |
print("β
TensorFlow imported successfully")
|
| 71 |
+
try:
|
| 72 |
+
model = load_model("lstm_model.h5", compile=False)
|
| 73 |
+
model.save("lstm_savedmodel", save_format="tf")
|
| 74 |
+
lstm_model = load_model("models/lstm_savedmodel", compile=False)
|
| 75 |
+
print("β
LSTM model loaded:", LSTM_PATH)
|
| 76 |
+
except Exception:
|
| 77 |
+
lstm_model = None
|
| 78 |
+
|
|
|
|
|
|
|
| 79 |
|
| 80 |
# ----------------------------
|
| 81 |
# Helpers
|