Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -15,14 +15,10 @@ def predict(image):
|
|
15 |
with torch.no_grad():
|
16 |
outputs = model(**inputs)
|
17 |
|
18 |
-
#
|
19 |
predictions = outputs.logits
|
20 |
-
|
21 |
-
# Convert predictions to a list and round to 2 decimal places if necessary
|
22 |
-
predictions_list = predictions.tolist()
|
23 |
-
rounded_predictions = [[round(pred, 2) for pred in prediction] for prediction in predictions_list]
|
24 |
|
25 |
-
return
|
26 |
|
27 |
# Create Gradio interface
|
28 |
iface = gr.Interface(
|
|
|
15 |
with torch.no_grad():
|
16 |
outputs = model(**inputs)
|
17 |
|
18 |
+
# Return the model's original outputs (e.g., logits or probabilities)
|
19 |
predictions = outputs.logits
|
|
|
|
|
|
|
|
|
20 |
|
21 |
+
return predictions
|
22 |
|
23 |
# Create Gradio interface
|
24 |
iface = gr.Interface(
|