Spaces:
Runtime error
Runtime error
File size: 420 Bytes
2f34ba3 22a70b4 28241bd 5367f56 22a70b4 28241bd | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # model_loader.py
import os
import tensorflow as tf
# Use the existing local model file
MODEL_PATH = "model/efficientnetv2s.h5"
def load_model():
if not os.path.exists(MODEL_PATH):
raise FileNotFoundError(f"Model file not found at {MODEL_PATH}")
print(f"Loading model from: {MODEL_PATH}")
model = tf.keras.models.load_model(MODEL_PATH)
print("Model loaded successfully!")
return model
|