Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -20,7 +20,7 @@ model.classifier[1] = nn.Linear(model.last_channel, len(class_names))
|
|
| 20 |
model.load_state_dict(torch.load(MODEL_PATH, map_location="cpu"))
|
| 21 |
model.eval()
|
| 22 |
|
| 23 |
-
#
|
| 24 |
transform = transforms.Compose([
|
| 25 |
transforms.Resize((224, 224)),
|
| 26 |
transforms.ToTensor(),
|
|
@@ -49,6 +49,6 @@ iface = gr.Interface(
|
|
| 49 |
allow_flagging="never"
|
| 50 |
)
|
| 51 |
|
|
|
|
| 52 |
if __name__ == "__main__":
|
| 53 |
-
iface.launch(
|
| 54 |
-
# Or use: iface.launch(share=True) if needed
|
|
|
|
| 20 |
model.load_state_dict(torch.load(MODEL_PATH, map_location="cpu"))
|
| 21 |
model.eval()
|
| 22 |
|
| 23 |
+
# Image transform
|
| 24 |
transform = transforms.Compose([
|
| 25 |
transforms.Resize((224, 224)),
|
| 26 |
transforms.ToTensor(),
|
|
|
|
| 49 |
allow_flagging="never"
|
| 50 |
)
|
| 51 |
|
| 52 |
+
# Launch Gradio with shareable link
|
| 53 |
if __name__ == "__main__":
|
| 54 |
+
iface.launch(share=True)
|
|
|