ktllc commited on
Commit
fc5f1b5
·
1 Parent(s): f2e596b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -35,7 +35,7 @@ def find_similarity(base64_image, text_input):
35
  similarity = (image_features @ text_features.T).squeeze(0).cpu().numpy()
36
 
37
  # Convert each element in the similarity array to Decimal
38
- similarity_decimal = [Decimal(score) for score in similarity]
39
 
40
  return similarity_decimal
41
 
@@ -46,7 +46,7 @@ iface = gr.Interface(
46
  gr.inputs.Textbox(label="Base64 Image", lines=8),
47
  "text"
48
  ],
49
- outputs="text", # Set the output type to "text"
50
  live=True,
51
  interpretation="default",
52
  title="CLIP Model Image-Text Cosine Similarity",
 
35
  similarity = (image_features @ text_features.T).squeeze(0).cpu().numpy()
36
 
37
  # Convert each element in the similarity array to Decimal
38
+ similarity_decimal = [Decimal(float(score)) for score in similarity]
39
 
40
  return similarity_decimal
41
 
 
46
  gr.inputs.Textbox(label="Base64 Image", lines=8),
47
  "text"
48
  ],
49
+ outputs="text",
50
  live=True,
51
  interpretation="default",
52
  title="CLIP Model Image-Text Cosine Similarity",