Spaces:
Runtime error
Runtime error
Make score output a number
Browse files
app.py
CHANGED
|
@@ -53,11 +53,11 @@ def score_image_caption_pair(uploaded_file, text_input):
|
|
| 53 |
local_image_path = save_file_to_disk(uploaded_file)
|
| 54 |
score = run_inference(
|
| 55 |
local_image_path, text_input, model, tokenizer).tolist()
|
| 56 |
-
return {"Score": score},
|
| 57 |
|
| 58 |
|
| 59 |
image = gr.inputs.Image(shape=(299, 299))
|
| 60 |
iface = gr.Interface(
|
| 61 |
-
fn=score_image_caption_pair, inputs=[image, "text"], outputs=["label", "
|
| 62 |
)
|
| 63 |
iface.launch()
|
|
|
|
| 53 |
local_image_path = save_file_to_disk(uploaded_file)
|
| 54 |
score = run_inference(
|
| 55 |
local_image_path, text_input, model, tokenizer).tolist()
|
| 56 |
+
return {"Score": score}, score
|
| 57 |
|
| 58 |
|
| 59 |
image = gr.inputs.Image(shape=(299, 299))
|
| 60 |
iface = gr.Interface(
|
| 61 |
+
fn=score_image_caption_pair, inputs=[image, "text"], outputs=["label", "number"]
|
| 62 |
)
|
| 63 |
iface.launch()
|