Spaces:
Runtime error
Runtime error
diamantrsd
commited on
Commit
•
654ca8c
1
Parent(s):
1355606
Update app.py
Browse files
app.py
CHANGED
@@ -47,12 +47,14 @@ def generate_caption(input_image):
|
|
47 |
translation_output = translation_model.generate(translation_inputs)
|
48 |
indonesian_caption = translation_tokenizer.decode(translation_output[0], skip_special_tokens=True)
|
49 |
|
50 |
-
return indonesian_caption
|
|
|
51 |
|
52 |
iface = gr.Interface(
|
53 |
-
generate_caption,
|
54 |
inputs=gr.inputs.Image(type="pil"),
|
55 |
-
outputs="text",
|
56 |
live=True
|
57 |
)
|
58 |
-
iface.launch()
|
|
|
|
47 |
translation_output = translation_model.generate(translation_inputs)
|
48 |
indonesian_caption = translation_tokenizer.decode(translation_output[0], skip_special_tokens=True)
|
49 |
|
50 |
+
return english_caption, indonesian_caption
|
51 |
+
|
52 |
|
53 |
iface = gr.Interface(
|
54 |
+
generate_caption,
|
55 |
inputs=gr.inputs.Image(type="pil"),
|
56 |
+
outputs=[gr.outputs.Text(type="text"), gr.outputs.Text(type="text")], # Dua output teks
|
57 |
live=True
|
58 |
)
|
59 |
+
iface.launch()
|
60 |
+
|