rishab1090 commited on
Commit
ef2d27b
·
verified ·
1 Parent(s): a6a0da8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -8,10 +8,16 @@ import os
8
  app = FastAPI()
9
 
10
  # Load your model
 
 
 
11
  model_path = "models/2.keras"
12
 
13
- # Change file permission manually before loading (if needed)
14
- os.chmod(model_path, 0o644) # Read/write for owner, read-only for others
 
 
 
15
 
16
  # Now load the model
17
  model = tf.keras.models.load_model(model_path)
 
8
  app = FastAPI()
9
 
10
  # Load your model
11
+ import os
12
+ import tensorflow as tf
13
+
14
  model_path = "models/2.keras"
15
 
16
+ # Just check if file is accessible
17
+ if os.path.exists(model_path):
18
+ model = tf.keras.models.load_model(model_path)
19
+ else:
20
+ raise FileNotFoundError("Model not found at: models/2.keras")
21
 
22
  # Now load the model
23
  model = tf.keras.models.load_model(model_path)