Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -57,7 +57,7 @@ def infer(image_input, audience):
|
|
57 |
paragraphs = result.split('\n')
|
58 |
|
59 |
# Join the paragraphs back with an extra empty line between each paragraph
|
60 |
-
formatted_text = '\n
|
61 |
|
62 |
|
63 |
return formatted_text, gr.Group.update(visible=True)
|
@@ -125,26 +125,27 @@ with gr.Blocks(css=css) as demo:
|
|
125 |
with gr.Column(elem_id="col-container"):
|
126 |
gr.Markdown(
|
127 |
"""
|
128 |
-
<h1 style="text-align: center">
|
129 |
<p style="text-align: center">์ด๋ฏธ์ง๋ฅผ ์
๋ก๋ํ์ธ์, ChatGPT๋ฅผ ํตํด ํ๊ตญ์ด๋ก ์ด์ผ๊ธฐ๋ฅผ ๋ง๋ค์ด ์ค๋๋ค!</p>
|
130 |
-
<p style="text-align: center">์๋ณธ https://huggingface.co/spaces/fffiloni/Image-to-Story ์์
|
|
|
131 |
"""
|
132 |
)
|
133 |
with gr.Row():
|
134 |
with gr.Column():
|
135 |
-
image_in = gr.Image(label="
|
136 |
-
audience = gr.Radio(label="
|
137 |
-
submit_btn = gr.Button('
|
138 |
with gr.Column():
|
139 |
#caption = gr.Textbox(label="Generated Caption")
|
140 |
-
story = gr.Textbox(label="
|
141 |
|
142 |
with gr.Group(elem_id="share-btn-container", visible=False) as share_group:
|
143 |
community_icon = gr.HTML(community_icon_html)
|
144 |
loading_icon = gr.HTML(loading_icon_html)
|
145 |
share_button = gr.Button("Share to community", elem_id="share-btn")
|
146 |
|
147 |
-
gr.Examples(examples=[["./examples/crabby.png", "
|
148 |
fn=infer,
|
149 |
inputs=[image_in, audience],
|
150 |
outputs=[story, share_group],
|
|
|
57 |
paragraphs = result.split('\n')
|
58 |
|
59 |
# Join the paragraphs back with an extra empty line between each paragraph
|
60 |
+
formatted_text = '\n'.join(paragraphs)
|
61 |
|
62 |
|
63 |
return formatted_text, gr.Group.update(visible=True)
|
|
|
125 |
with gr.Column(elem_id="col-container"):
|
126 |
gr.Markdown(
|
127 |
"""
|
128 |
+
<h1 style="text-align: center">Image to Story - Korean</h1>
|
129 |
<p style="text-align: center">์ด๋ฏธ์ง๋ฅผ ์
๋ก๋ํ์ธ์, ChatGPT๋ฅผ ํตํด ํ๊ตญ์ด๋ก ์ด์ผ๊ธฐ๋ฅผ ๋ง๋ค์ด ์ค๋๋ค!</p>
|
130 |
+
<p style="text-align: center">์๋ณธ https://huggingface.co/spaces/fffiloni/Image-to-Story ์์ ํ๊ตญ์ด๋ก ๊ธ์ ์์ฑํ๊ฒ ํ๊ณ , Llama ๋ฅผ ChatGPT ๋ก ์์ ํ ๊ฒ์
๋๋ค.</p>
|
131 |
+
<p style="text-align: center">ChatGPT ์ฌ์ฉ์ ํ์ผ๋ก ์๋ ์ ์์ต๋๋ค.</p>
|
132 |
"""
|
133 |
)
|
134 |
with gr.Row():
|
135 |
with gr.Column():
|
136 |
+
image_in = gr.Image(label="์ด๋ฏธ์ง ์
๋ ฅ", type="filepath", elem_id="image-in", height=420)
|
137 |
+
audience = gr.Radio(label="๋์", choices=["์ด๋ฆฐ์ด", "์ฑ์ธ"], value="์ด๋ฆฐ์ด")
|
138 |
+
submit_btn = gr.Button('๊ธ์ ๋ง๋ค์ด ์ฃผ์ธ์')
|
139 |
with gr.Column():
|
140 |
#caption = gr.Textbox(label="Generated Caption")
|
141 |
+
story = gr.Textbox(label="์์ฑ๋ ์คํ ๋ฆฌ", elem_id="story")
|
142 |
|
143 |
with gr.Group(elem_id="share-btn-container", visible=False) as share_group:
|
144 |
community_icon = gr.HTML(community_icon_html)
|
145 |
loading_icon = gr.HTML(loading_icon_html)
|
146 |
share_button = gr.Button("Share to community", elem_id="share-btn")
|
147 |
|
148 |
+
gr.Examples(examples=[["./examples/crabby.png", "์ด๋ฆฐ์ด"],["./examples/hopper.jpeg", "์ฑ์ธ"]],
|
149 |
fn=infer,
|
150 |
inputs=[image_in, audience],
|
151 |
outputs=[story, share_group],
|