Spaces:
Running on Zero
Running on Zero
changes
Browse files
app.py
CHANGED
|
@@ -46,7 +46,7 @@ def predict(image):
|
|
| 46 |
|
| 47 |
with torch.no_grad():
|
| 48 |
outputs = model(img_tensor)
|
| 49 |
-
probabilities = torch.nn.functional.softmax(outputs
|
| 50 |
|
| 51 |
return {LABELS[i]: float(probabilities[i]) for i in range(len(LABELS))}
|
| 52 |
|
|
@@ -59,6 +59,4 @@ demo = gradio.Interface(
|
|
| 59 |
)
|
| 60 |
|
| 61 |
if __name__ == "__main__":
|
| 62 |
-
demo.launch(
|
| 63 |
-
server_port=7860,
|
| 64 |
-
ssr_mode=False)
|
|
|
|
| 46 |
|
| 47 |
with torch.no_grad():
|
| 48 |
outputs = model(img_tensor)
|
| 49 |
+
probabilities = torch.nn.functional.softmax(outputs.squeeze(0), dim=0)
|
| 50 |
|
| 51 |
return {LABELS[i]: float(probabilities[i]) for i in range(len(LABELS))}
|
| 52 |
|
|
|
|
| 59 |
)
|
| 60 |
|
| 61 |
if __name__ == "__main__":
|
| 62 |
+
demo.launch()
|
|
|
|
|
|