seawolf2357 commited on
Commit
37b5458
Β·
verified Β·
1 Parent(s): f814fbc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -6
app.py CHANGED
@@ -69,14 +69,16 @@ def gradio_generate_contents(user_content, brand_name, aspect_ratio):
69
 
70
  def gradio_generate_status(content_id):
71
  download_url = generate_status(content_id)
 
 
72
  if download_url != 'FAILED':
73
  display_text = download_url[:10] + '...' if len(download_url) > 10 else download_url
74
  html_link = f'<a href="{download_url}" target="_blank">{display_text}</a>'
75
  html_video = f'<iframe src="{download_url}" width="640" height="360" frameborder="0" allowfullscreen></iframe>'
76
- return html_link + '<br>' + html_video
77
  else:
78
- return "컨텐츠 생성 μ‹€νŒ¨ λ˜λŠ” IDκ°€ 잘λͺ»λ˜μ—ˆμŠ΅λ‹ˆλ‹€."
79
-
80
  # 컨텐츠 생성 μΈν„°νŽ˜μ΄μŠ€
81
  iface_create = gr.Interface(
82
  fn=gradio_generate_contents,
@@ -108,11 +110,15 @@ iface_create = gr.Interface(
108
  ]
109
  )
110
 
111
- # μƒνƒœ 확인 및 λΉ„λ””μ˜€ λ‹€μš΄λ‘œλ“œ μΈν„°νŽ˜μ΄μŠ€
112
  iface_status = gr.Interface(
113
  fn=gradio_generate_status,
114
  inputs=gr.Textbox(label="컨텐츠 ID"),
115
- outputs=gr.HTML(label="λ‹€μš΄λ‘œλ“œ 링크 및 λΉ„λ””μ˜€"),
 
 
 
 
116
  examples=[
117
  ["659f5a3f096a487442e72dee"],
118
  ["659f6651d4c72225a9895ebb"]
@@ -121,4 +127,4 @@ iface_status = gr.Interface(
121
 
122
  # 두 μΈν„°νŽ˜μ΄μŠ€λ₯Ό νƒ­μœΌλ‘œ ꡬ성
123
  iface_combined = gr.TabbedInterface([iface_create, iface_status], ["컨텐츠 생성", "μƒνƒœ 확인 및 λ‹€μš΄λ‘œλ“œ"])
124
- iface_combined.launch()
 
69
 
70
  def gradio_generate_status(content_id):
71
  download_url = generate_status(content_id)
72
+ markdown_text = "μžλ™ μƒμ„±λœ μ˜μƒμ— λŒ€ν•œ μˆ˜μ • 및 νŽΈμ§‘ μš”μ²­ 클릭: [μ—¬κΈ°λ₯Ό ν΄λ¦­ν•˜μ„Έμš”](https://forms.gle/u9hPDFbntLEp8xH6A)"
73
+
74
  if download_url != 'FAILED':
75
  display_text = download_url[:10] + '...' if len(download_url) > 10 else download_url
76
  html_link = f'<a href="{download_url}" target="_blank">{display_text}</a>'
77
  html_video = f'<iframe src="{download_url}" width="640" height="360" frameborder="0" allowfullscreen></iframe>'
78
+ return html_link + '<br>' + html_video, markdown_text
79
  else:
80
+ return "컨텐츠 생성 μ‹€νŒ¨ λ˜λŠ” IDκ°€ 잘λͺ»λ˜μ—ˆμŠ΅λ‹ˆλ‹€.", markdown_text
81
+
82
  # 컨텐츠 생성 μΈν„°νŽ˜μ΄μŠ€
83
  iface_create = gr.Interface(
84
  fn=gradio_generate_contents,
 
110
  ]
111
  )
112
 
113
+ # μƒνƒœ 확인 및 λΉ„λ””μ˜€ λ‹€μš΄λ‘œλ“œ μΈν„°νŽ˜μ΄μŠ€μ— λ§ˆν¬λ‹€μš΄ μΆ”κ°€
114
  iface_status = gr.Interface(
115
  fn=gradio_generate_status,
116
  inputs=gr.Textbox(label="컨텐츠 ID"),
117
+ outputs=[
118
+ gr.HTML(label="λ‹€μš΄λ‘œλ“œ 링크 및 λΉ„λ””μ˜€"),
119
+ gr.Markdown("μžλ™ μƒμ„±λœ μ˜μƒμ— λŒ€ν•œ μˆ˜μ • 및 νŽΈμ§‘ μš”μ²­ 클릭: [μ—¬κΈ°λ₯Ό ν΄λ¦­ν•˜μ„Έμš”](https://forms.gle/u9hPDFbntLEp8xH6A)")
120
+ ],
121
+ # μ˜ˆμ‹œλ“€μ€ 여기에 포함될 수 μžˆμŠ΅λ‹ˆλ‹€.
122
  examples=[
123
  ["659f5a3f096a487442e72dee"],
124
  ["659f6651d4c72225a9895ebb"]
 
127
 
128
  # 두 μΈν„°νŽ˜μ΄μŠ€λ₯Ό νƒ­μœΌλ‘œ ꡬ성
129
  iface_combined = gr.TabbedInterface([iface_create, iface_status], ["컨텐츠 생성", "μƒνƒœ 확인 및 λ‹€μš΄λ‘œλ“œ"])
130
+ iface_combined.launch()