Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,7 +5,7 @@ update_validator = Update_Validator(text_model="DistilRoBERTa-v1", image_model="
|
|
| 5 |
|
| 6 |
def gradio_interface(text1, image1, text2, image2, threshold=0.75):
|
| 7 |
out = update_validator.validate(text1=text1, image1=image1, text2=text2, image2=image2, threshold=threshold, return_score=True)
|
| 8 |
-
return out['score'], label['label']
|
| 9 |
|
| 10 |
inputs = [
|
| 11 |
gr.components.Textbox(lines=5, label="Description 1"),
|
|
@@ -16,7 +16,7 @@ inputs = [
|
|
| 16 |
]
|
| 17 |
|
| 18 |
outputs = [
|
| 19 |
-
gr.
|
| 20 |
gr.Textbox(label="Update Label")
|
| 21 |
]
|
| 22 |
|
|
|
|
| 5 |
|
| 6 |
def gradio_interface(text1, image1, text2, image2, threshold=0.75):
|
| 7 |
out = update_validator.validate(text1=text1, image1=image1, text2=text2, image2=image2, threshold=threshold, return_score=True)
|
| 8 |
+
return out['score'], "Valid" if label['label'] else "Invalid"
|
| 9 |
|
| 10 |
inputs = [
|
| 11 |
gr.components.Textbox(lines=5, label="Description 1"),
|
|
|
|
| 16 |
]
|
| 17 |
|
| 18 |
outputs = [
|
| 19 |
+
gr.Number(label="Similarity Score"),
|
| 20 |
gr.Textbox(label="Update Label")
|
| 21 |
]
|
| 22 |
|