Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -45,16 +45,19 @@ def gradio_fetch_and_format_script(url):
|
|
45 |
return format_script(main_content)
|
46 |
|
47 |
# Gradio ์ธํฐํ์ด์ค ๊ตฌ์ฑ
|
48 |
-
|
49 |
-
fn=
|
50 |
-
"html_content": gradio_fetch_and_parse, # ์คํฌ๋ฉ๋ HTML ๋ด์ฉ์ ๋ณด์ฌ์ฃผ๋ ํจ์
|
51 |
-
"final_script": gradio_fetch_and_format_script # ์ต์ข
์คํฌ๋ฆฝํธ๋ฅผ ์์ฑํ๋ ํจ์
|
52 |
-
},
|
53 |
inputs=gr.Textbox(label="URL์ ์
๋ ฅํ์ธ์"),
|
54 |
-
outputs=
|
55 |
-
gr.Textbox(label="์คํฌ๋ฉ๋ HTML ์ฝํ
์ธ "), # ์คํฌ๋ฉ๋ HTML ๋ด์ฉ์ ๋ณด์ฌ์ค ์ถ๋ ฅ์ฐฝ
|
56 |
-
gr.Textbox(label="์์์ฉ ์คํฌ๋ฆฝํธ") # ์ต์ข
์์ฑ๋ ํ
์คํธ(์คํฌ๋ฆฝํธ)๋ฅผ ๋ณด์ฌ์ค ์ถ๋ ฅ์ฐฝ
|
57 |
-
]
|
58 |
)
|
59 |
|
60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
return format_script(main_content)
|
46 |
|
47 |
# Gradio ์ธํฐํ์ด์ค ๊ตฌ์ฑ
|
48 |
+
iface_html = gr.Interface(
|
49 |
+
fn=gradio_fetch_and_parse,
|
|
|
|
|
|
|
50 |
inputs=gr.Textbox(label="URL์ ์
๋ ฅํ์ธ์"),
|
51 |
+
outputs=gr.Textbox(label="์คํฌ๋ฉ๋ HTML ์ฝํ
์ธ ")
|
|
|
|
|
|
|
52 |
)
|
53 |
|
54 |
+
iface_script = gr.Interface(
|
55 |
+
fn=gradio_fetch_and_format_script,
|
56 |
+
inputs=gr.Textbox(label="URL์ ์
๋ ฅํ์ธ์"),
|
57 |
+
outputs=gr.Textbox(label="์์์ฉ ์คํฌ๋ฆฝํธ")
|
58 |
+
)
|
59 |
+
|
60 |
+
# ๋ ์ธํฐํ์ด์ค๋ฅผ ํญ์ผ๋ก ๊ตฌ์ฑํ์ฌ ์คํ
|
61 |
+
iface_combined = gr.TabbedInterface(interfaces=[iface_html, iface_script],
|
62 |
+
tab_names=["HTML ๋ณด๊ธฐ", "์คํฌ๋ฆฝํธ ์์ฑ"])
|
63 |
+
iface_combined.launch()
|