Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,7 @@ import gradio as gr
|
|
2 |
from transformers import AutoModel
|
3 |
from PIL import Image
|
4 |
import torch
|
5 |
-
|
6 |
# Load JinaAI CLIP model
|
7 |
model = AutoModel.from_pretrained("jinaai/jina-clip-v1", trust_remote_code=True)
|
8 |
|
@@ -58,11 +58,11 @@ with gr.Blocks() as demo:
|
|
58 |
|
59 |
with gr.Row():
|
60 |
input1_text = gr.Textbox(label="Text Input 1", visible=True)
|
61 |
-
input1_image = gr.Image(type="numpy",
|
62 |
|
63 |
with gr.Row():
|
64 |
input2_text = gr.Textbox(label="Text Input 2", visible=False)
|
65 |
-
input2_image = gr.Image(type="numpy",
|
66 |
|
67 |
output = gr.Textbox(label="Similarity Score / Error", interactive=False)
|
68 |
|
@@ -75,4 +75,4 @@ with gr.Blocks() as demo:
|
|
75 |
btn = gr.Button("Compute Similarity")
|
76 |
btn.click(compute_similarity, inputs=[input1_text, input2_text, input1_type, input2_type], outputs=output)
|
77 |
|
78 |
-
demo.launch()
|
|
|
2 |
from transformers import AutoModel
|
3 |
from PIL import Image
|
4 |
import torch
|
5 |
+
|
6 |
# Load JinaAI CLIP model
|
7 |
model = AutoModel.from_pretrained("jinaai/jina-clip-v1", trust_remote_code=True)
|
8 |
|
|
|
58 |
|
59 |
with gr.Row():
|
60 |
input1_text = gr.Textbox(label="Text Input 1", visible=True)
|
61 |
+
input1_image = gr.Image(type="numpy", interactive=True, label="Image Input 1", visible=False)
|
62 |
|
63 |
with gr.Row():
|
64 |
input2_text = gr.Textbox(label="Text Input 2", visible=False)
|
65 |
+
input2_image = gr.Image(type="numpy", interactive=True, label="Image Input 2", visible=True)
|
66 |
|
67 |
output = gr.Textbox(label="Similarity Score / Error", interactive=False)
|
68 |
|
|
|
75 |
btn = gr.Button("Compute Similarity")
|
76 |
btn.click(compute_similarity, inputs=[input1_text, input2_text, input1_type, input2_type], outputs=output)
|
77 |
|
78 |
+
demo.launch()
|