Update app/model_loader.py
Browse files- app/model_loader.py +8 -5
app/model_loader.py
CHANGED
|
@@ -1,8 +1,11 @@
|
|
| 1 |
-
import
|
| 2 |
import tensorflow as tf
|
| 3 |
|
| 4 |
-
MODEL_PATH = "app/model/efficientnetv2s.h5"
|
| 5 |
-
|
| 6 |
def load_model():
|
| 7 |
-
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from huggingface_hub import hf_hub_download
|
| 2 |
import tensorflow as tf
|
| 3 |
|
|
|
|
|
|
|
| 4 |
def load_model():
|
| 5 |
+
# Download the model file from the public repo
|
| 6 |
+
model_path = hf_hub_download(
|
| 7 |
+
repo_id="Miguel764/efficientnetv2s-skin-cancer-classifier", # public repo
|
| 8 |
+
filename="efficientnetv2s.h5" # file name inside the repo
|
| 9 |
+
)
|
| 10 |
+
# Load the downloaded model
|
| 11 |
+
return tf.keras.models.load_model(model_path)
|