Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -29,9 +29,13 @@ def predict(image,max_length=64, num_beams=4):
|
|
29 |
caption_text = clean_text(tokenizer.decode(caption_ids))
|
30 |
return caption_text
|
31 |
|
32 |
-
|
33 |
-
|
34 |
-
|
|
|
|
|
|
|
|
|
35 |
"""
|
36 |
<div style="text-align: center; max-width: 1200px; margin: 20px auto;">
|
37 |
<h1 style="font-weight: 900; font-size: 3rem; margin: 0rem">
|
@@ -43,14 +47,6 @@ with gr.Blocks() as demo:
|
|
43 |
</h2>
|
44 |
</div>
|
45 |
""")
|
46 |
-
|
47 |
-
print("------------------------- 5 -------------------------\n")
|
48 |
-
input = gr.inputs.Image(label="Upload any Image", type = 'pil', optional=True)
|
49 |
-
output = gr.outputs.Textbox(type="text",label="Captions")
|
50 |
-
examples = ["example1.jpg"]
|
51 |
-
print("------------------------- 6 -------------------------\n")
|
52 |
-
# title = "Image to - Text"
|
53 |
-
description = "NTT Data"
|
54 |
interface = gr.Interface(
|
55 |
|
56 |
fn=predict,
|
|
|
29 |
caption_text = clean_text(tokenizer.decode(caption_ids))
|
30 |
return caption_text
|
31 |
|
32 |
+
print("------------------------- 5 -------------------------\n")
|
33 |
+
input = gr.inputs.Image(label="Upload any Image", type = 'pil', optional=True)
|
34 |
+
output = gr.outputs.Textbox(type="text",label="Captions")
|
35 |
+
examples = ["example1.jpg"]
|
36 |
+
print("------------------------- 6 -------------------------\n")
|
37 |
+
# title = "Image to - Text"
|
38 |
+
description = gr.HTML(
|
39 |
"""
|
40 |
<div style="text-align: center; max-width: 1200px; margin: 20px auto;">
|
41 |
<h1 style="font-weight: 900; font-size: 3rem; margin: 0rem">
|
|
|
47 |
</h2>
|
48 |
</div>
|
49 |
""")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
interface = gr.Interface(
|
51 |
|
52 |
fn=predict,
|