Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -39,12 +39,11 @@ def load_model():
|
|
| 39 |
# Try loading with different configurations
|
| 40 |
try:
|
| 41 |
logger.info("Attempting to load model with custom objects...")
|
| 42 |
-
|
| 43 |
-
model = tf_keras.models.load_model(model_path, compile=False)
|
| 44 |
except Exception as e:
|
| 45 |
logger.error(f"Failed to load with custom objects: {str(e)}")
|
| 46 |
logger.info("Attempting to load model without custom objects...")
|
| 47 |
-
model = tf_keras.models.load_model(model_path
|
| 48 |
|
| 49 |
# Verify model loaded correctly
|
| 50 |
if model is None:
|
|
|
|
| 39 |
# Try loading with different configurations
|
| 40 |
try:
|
| 41 |
logger.info("Attempting to load model with custom objects...")
|
| 42 |
+
model = tf_keras.models.load_model(model_path, custom_objects={'KerasLayer': hub.KerasLayer})
|
|
|
|
| 43 |
except Exception as e:
|
| 44 |
logger.error(f"Failed to load with custom objects: {str(e)}")
|
| 45 |
logger.info("Attempting to load model without custom objects...")
|
| 46 |
+
model = tf_keras.models.load_model(model_path)
|
| 47 |
|
| 48 |
# Verify model loaded correctly
|
| 49 |
if model is None:
|