Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -15,8 +15,9 @@ def classify_image_with_text(text, image):
|
|
15 |
)
|
16 |
outputs = model(**inputs)
|
17 |
logits_per_image = outputs.logits_per_image # this is the image-text similarity score
|
18 |
-
probs = logits_per_image.softmax(dim=1)
|
19 |
-
|
|
|
20 |
|
21 |
# Créer l'interface Gradio avec l'API de Gradio Blocks
|
22 |
with gr.Interface(
|
|
|
15 |
)
|
16 |
outputs = model(**inputs)
|
17 |
logits_per_image = outputs.logits_per_image # this is the image-text similarity score
|
18 |
+
probs = logits_per_image.softmax(dim=1)
|
19 |
+
predicted_class_index = probs.argmax(dim=1).item()
|
20 |
+
return predicted_class_index
|
21 |
|
22 |
# Créer l'interface Gradio avec l'API de Gradio Blocks
|
23 |
with gr.Interface(
|