Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -38,7 +38,6 @@ def generate_contents(user_content, brand_name, aspect_ratio='landscape'):
|
|
38 |
"backgroundMusicKeywords": "happy, lofi, beats"
|
39 |
}
|
40 |
|
41 |
-
|
42 |
headers = set_header()
|
43 |
response = requests.request("POST", url, json=payload, headers=headers).json()
|
44 |
|
@@ -65,9 +64,12 @@ def generate_status(content_id):
|
|
65 |
else:
|
66 |
break
|
67 |
return 'FAILED'
|
|
|
68 |
# Gradio ์ธํฐํ์ด์ค ํจ์
|
69 |
def gradio_generate_contents(user_content, brand_name, aspect_ratio):
|
70 |
-
|
|
|
|
|
71 |
|
72 |
def gradio_generate_status(content_id):
|
73 |
download_url = generate_status(content_id)
|
@@ -80,11 +82,6 @@ def gradio_generate_status(content_id):
|
|
80 |
return html_link + '<br>' + html_video, markdown_text
|
81 |
else:
|
82 |
return "์ปจํ
์ธ ์์ฑ ์คํจ ๋๋ ID๊ฐ ์๋ชป๋์์ต๋๋ค.", markdown_text
|
83 |
-
|
84 |
-
def gradio_generate_contents(user_content, brand_name, aspect_ratio):
|
85 |
-
content_id = generate_contents(user_content, brand_name, aspect_ratio)
|
86 |
-
markdown_text = "๋น๋์ค ์คํฌ๋ฆฝํธ ์๋ ์์ฑ ํด๋ฆญ: [์ฌ๊ธฐ๋ฅผ ํด๋ฆญํ์ธ์](https://seawolf2357-hyejascript.hf.space)"
|
87 |
-
return content_id, markdown_text
|
88 |
|
89 |
iface_create = gr.Interface(
|
90 |
fn=gradio_generate_contents,
|
@@ -111,8 +108,6 @@ iface_create = gr.Interface(
|
|
111 |
]
|
112 |
)
|
113 |
|
114 |
-
|
115 |
-
# ์ํ ํ์ธ ๋ฐ ๋น๋์ค ๋ค์ด๋ก๋ ์ธํฐํ์ด์ค
|
116 |
iface_status = gr.Interface(
|
117 |
fn=gradio_generate_status,
|
118 |
inputs=gr.Textbox(label="์ปจํ
์ธ ID"),
|
@@ -122,6 +117,5 @@ iface_status = gr.Interface(
|
|
122 |
]
|
123 |
)
|
124 |
|
125 |
-
# ๋ ์ธํฐํ์ด์ค๋ฅผ ํญ์ผ๋ก ๊ตฌ์ฑ
|
126 |
iface_combined = gr.TabbedInterface([iface_create, iface_status], ["์ปจํ
์ธ ์์ฑ", "์ํ ํ์ธ ๋ฐ ๋ค์ด๋ก๋"])
|
127 |
iface_combined.launch(auth=("arxivgpt", "Arxiv1234!@"))
|
|
|
38 |
"backgroundMusicKeywords": "happy, lofi, beats"
|
39 |
}
|
40 |
|
|
|
41 |
headers = set_header()
|
42 |
response = requests.request("POST", url, json=payload, headers=headers).json()
|
43 |
|
|
|
64 |
else:
|
65 |
break
|
66 |
return 'FAILED'
|
67 |
+
|
68 |
# Gradio ์ธํฐํ์ด์ค ํจ์
|
69 |
def gradio_generate_contents(user_content, brand_name, aspect_ratio):
|
70 |
+
content_id = generate_contents(user_content, brand_name, aspect_ratio)
|
71 |
+
markdown_text = "๋น๋์ค ์คํฌ๋ฆฝํธ ์๋ ์์ฑ ํด๋ฆญ: [์ฌ๊ธฐ๋ฅผ ํด๋ฆญํ์ธ์](https://seawolf2357-hyejascript.hf.space)"
|
72 |
+
return content_id, markdown_text
|
73 |
|
74 |
def gradio_generate_status(content_id):
|
75 |
download_url = generate_status(content_id)
|
|
|
82 |
return html_link + '<br>' + html_video, markdown_text
|
83 |
else:
|
84 |
return "์ปจํ
์ธ ์์ฑ ์คํจ ๋๋ ID๊ฐ ์๋ชป๋์์ต๋๋ค.", markdown_text
|
|
|
|
|
|
|
|
|
|
|
85 |
|
86 |
iface_create = gr.Interface(
|
87 |
fn=gradio_generate_contents,
|
|
|
108 |
]
|
109 |
)
|
110 |
|
|
|
|
|
111 |
iface_status = gr.Interface(
|
112 |
fn=gradio_generate_status,
|
113 |
inputs=gr.Textbox(label="์ปจํ
์ธ ID"),
|
|
|
117 |
]
|
118 |
)
|
119 |
|
|
|
120 |
iface_combined = gr.TabbedInterface([iface_create, iface_status], ["์ปจํ
์ธ ์์ฑ", "์ํ ํ์ธ ๋ฐ ๋ค์ด๋ก๋"])
|
121 |
iface_combined.launch(auth=("arxivgpt", "Arxiv1234!@"))
|