prasad6145 commited on
Commit
96e7acf
·
verified ·
1 Parent(s): f6b3de0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -0
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