DawnC commited on
Commit
ad1101d
1 Parent(s): 853de85

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -175,7 +175,11 @@ def predict(image):
175
  try:
176
  image_tensor = preprocess_image(image)
177
  with torch.no_grad():
178
- logits, * = model(image_tensor)
 
 
 
 
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