Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -175,7 +175,11 @@ def predict(image):
|
|
| 175 |
try:
|
| 176 |
image_tensor = preprocess_image(image)
|
| 177 |
with torch.no_grad():
|
| 178 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 179 |
_, predicted = torch.max(logits, 1)
|
| 180 |
breed = dog_breeds[predicted.item()] # Map label to breed name
|
| 181 |
|
|
|
|
| 175 |
try:
|
| 176 |
image_tensor = preprocess_image(image)
|
| 177 |
with torch.no_grad():
|
| 178 |
+
output = model(image_tensor)
|
| 179 |
+
if isinstance(output, tuple):
|
| 180 |
+
logits = output[0]
|
| 181 |
+
else:
|
| 182 |
+
logits = output
|
| 183 |
_, predicted = torch.max(logits, 1)
|
| 184 |
breed = dog_breeds[predicted.item()] # Map label to breed name
|
| 185 |
|