seawolf2357 commited on
Commit
8904944
ยท
verified ยท
1 Parent(s): cd4d38d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -10
app.py CHANGED
@@ -45,16 +45,19 @@ def gradio_fetch_and_format_script(url):
45
  return format_script(main_content)
46
 
47
  # Gradio ์ธํ„ฐํŽ˜์ด์Šค ๊ตฌ์„ฑ
48
- iface = gr.Interface(
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
- iface.launch()
 
 
 
 
 
 
 
 
 
 
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()