Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,8 +3,18 @@ import tensorflow as tf
|
|
3 |
from huggingface_hub import from_pretrained_keras
|
4 |
import numpy as np
|
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
-
model = from_pretrained_keras("keras-io/mobile-vit-xxs")
|
|
|
8 |
|
9 |
classes=['dandelion','daisy','tulips','sunflower','rose']
|
10 |
image_size = 256
|
|
|
3 |
from huggingface_hub import from_pretrained_keras
|
4 |
import numpy as np
|
5 |
|
6 |
+
from huggingface_hub import hf_hub_download
|
7 |
+
from keras.layers import TFSMLayer
|
8 |
+
import numpy as np
|
9 |
+
|
10 |
+
# Download the model
|
11 |
+
model_path = hf_hub_download("keras-io/mobile-vit-xxs")
|
12 |
+
|
13 |
+
# Load the model using TFSMLayer
|
14 |
+
model = TFSMLayer(model_path, call_endpoint='serving_default')
|
15 |
|
16 |
+
''' model = from_pretrained_keras("keras-io/mobile-vit-xxs")
|
17 |
+
'''
|
18 |
|
19 |
classes=['dandelion','daisy','tulips','sunflower','rose']
|
20 |
image_size = 256
|