Saad0KH commited on
Commit
378936b
·
verified ·
1 Parent(s): 3cf7cf7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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
- return probs
 
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(