Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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=
|
|
|
|
|
|
|
|
|
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()
|