Update app.py
Browse files
app.py
CHANGED
|
@@ -10,7 +10,7 @@ labels = response.text.split("\n")
|
|
| 10 |
|
| 11 |
def get_predictions(inp):
|
| 12 |
inp = transforms.ToTensor()(inp).unsqueeze(0)
|
| 13 |
-
predictions = torch.nn.
|
| 14 |
conf = {labels[i]: predictions[i] for i in range(len(labels))}
|
| 15 |
return conf
|
| 16 |
|
|
|
|
| 10 |
|
| 11 |
def get_predictions(inp):
|
| 12 |
inp = transforms.ToTensor()(inp).unsqueeze(0)
|
| 13 |
+
predictions = torch.nn.functional.softmax(model(inp)[0], dim = 0)
|
| 14 |
conf = {labels[i]: predictions[i] for i in range(len(labels))}
|
| 15 |
return conf
|
| 16 |
|