Spaces:
Runtime error
Runtime error
SMeyersMrOvkill
commited on
Commit
•
63da240
1
Parent(s):
4c6e016
app
Browse files
app.py
CHANGED
@@ -100,11 +100,15 @@ def xform_image_description(img, inst):
|
|
100 |
return res.choices[0].text[len(prompt):].split("```")[0]
|
101 |
|
102 |
def simple_desc(img, prompt):
|
103 |
-
|
|
|
|
|
|
|
|
|
104 |
|
105 |
-
ifc = gr.
|
106 |
[
|
107 |
-
gr.Interface(simple_desc, inputs=[gr.Image(label="input", type="pil")], outputs=[gr.Textbox(label="prompt")])
|
108 |
]
|
109 |
)
|
110 |
|
@@ -141,4 +145,4 @@ with gr.Blocks() as demo:
|
|
141 |
demo.launch(debug=True, share=True)
|
142 |
"""
|
143 |
with gr.TabbedInterface([ifc], ["Prompt & Image 2 Text"]) as ifc:
|
144 |
-
ifc.launch(share=False)
|
|
|
100 |
return res.choices[0].text[len(prompt):].split("```")[0]
|
101 |
|
102 |
def simple_desc(img, prompt):
|
103 |
+
gen = md(img, prompt)
|
104 |
+
total = ""
|
105 |
+
for resp in gen:
|
106 |
+
yield total := total + resp
|
107 |
+
return
|
108 |
|
109 |
+
ifc = gr.Interface(
|
110 |
[
|
111 |
+
gr.Interface(simple_desc, inputs=[gr.Image(label="input", type="pil"), gr.Textbox(label="prompt")], outputs=[gr.Textbox(label="prompt")])
|
112 |
]
|
113 |
)
|
114 |
|
|
|
145 |
demo.launch(debug=True, share=True)
|
146 |
"""
|
147 |
with gr.TabbedInterface([ifc], ["Prompt & Image 2 Text"]) as ifc:
|
148 |
+
ifc.launch(share=False, server_host="0.0.0.0", server_port=7860)
|