wonwizard commited on
Commit
c6bdca0
ยท
1 Parent(s): 4a76a56

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -8
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\n'.join(paragraphs)
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">Korean Image to Story</h1>
129
  <p style="text-align: center">์ด๋ฏธ์ง€๋ฅผ ์—…๋กœ๋“œํ•˜์„ธ์š”, ChatGPT๋ฅผ ํ†ตํ•ด ํ•œ๊ตญ์–ด๋กœ ์ด์•ผ๊ธฐ๋ฅผ ๋งŒ๋“ค์–ด ์ค๋‹ˆ๋‹ค!</p>
130
- <p style="text-align: center">์›๋ณธ https://huggingface.co/spaces/fffiloni/Image-to-Story ์—์„œ ์กฐ๊ธˆ ์ˆ˜์ •ํ•œ ๊ฒƒ์ž…๋‹ˆ๋‹ค.</p>
 
131
  """
132
  )
133
  with gr.Row():
134
  with gr.Column():
135
- image_in = gr.Image(label="Image input", type="filepath", elem_id="image-in", height=420)
136
- audience = gr.Radio(label="Target Audience", choices=["Children", "Adult"], value="Children")
137
- submit_btn = gr.Button('Tell me a story')
138
  with gr.Column():
139
  #caption = gr.Textbox(label="Generated Caption")
140
- story = gr.Textbox(label="generated Story", elem_id="story")
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", "Children"],["./examples/hopper.jpeg", "Adult"]],
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],