Spaces:
Build error
Build error
changed load weights_only to false
Browse files
app.py
CHANGED
|
@@ -36,7 +36,7 @@ model = None
|
|
| 36 |
# Load model
|
| 37 |
try:
|
| 38 |
model = timm.create_model('vit_base_patch16_224', pretrained=False, num_classes=47)
|
| 39 |
-
model.load_state_dict(torch.load(model_path, weights_only=
|
| 40 |
model.eval()
|
| 41 |
except Exception as e:
|
| 42 |
print(f"Error loading model: {str(e)}")
|
|
@@ -96,4 +96,4 @@ demo = gr.Interface(
|
|
| 96 |
)
|
| 97 |
|
| 98 |
if __name__ == "__main__":
|
| 99 |
-
demo.launch()
|
|
|
|
| 36 |
# Load model
|
| 37 |
try:
|
| 38 |
model = timm.create_model('vit_base_patch16_224', pretrained=False, num_classes=47)
|
| 39 |
+
model.load_state_dict(torch.load(model_path, weights_only=False))
|
| 40 |
model.eval()
|
| 41 |
except Exception as e:
|
| 42 |
print(f"Error loading model: {str(e)}")
|
|
|
|
| 96 |
)
|
| 97 |
|
| 98 |
if __name__ == "__main__":
|
| 99 |
+
demo.launch()
|