Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,13 @@ import gradio as gr
|
|
5 |
import numpy as np
|
6 |
import tensorflow as tf
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
# Load the trained model
|
9 |
model = tf.keras.models.load_model("sleep_cognition_model.h5")
|
10 |
|
|
|
5 |
import numpy as np
|
6 |
import tensorflow as tf
|
7 |
|
8 |
+
# Ensure the model file exists before loading
|
9 |
+
model_path = "sleep_cognition_model.h5"
|
10 |
+
|
11 |
+
if not os.path.exists(model_path):
|
12 |
+
raise FileNotFoundError(f"⚠️ Model file not found: {model_path}. Please upload it.")
|
13 |
+
|
14 |
+
|
15 |
# Load the trained model
|
16 |
model = tf.keras.models.load_model("sleep_cognition_model.h5")
|
17 |
|