Kims12 commited on
Commit
aa70416
ยท
verified ยท
1 Parent(s): c947445

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -17
app.py CHANGED
@@ -90,20 +90,24 @@ def scrape_naver_blog(url):
90
 
91
  return f"{output_title}\n\n{output_content}", final_debug_info
92
 
93
- # Gradio ์ธํ„ฐํŽ˜์ด์Šค ๊ตฌ์„ฑ
94
- title = "๋„ค์ด๋ฒ„ ๋ธ”๋กœ๊ทธ ์Šคํฌ๋ž˜ํผ"
95
- description = "๋„ค์ด๋ฒ„ ๋ธ”๋กœ๊ทธ URL์„ ์ž…๋ ฅํ•˜๋ฉด ์ œ๋ชฉ๊ณผ ๋‚ด์šฉ์„ ์Šคํฌ๋ž˜ํ•‘ํ•ฉ๋‹ˆ๋‹ค."
96
-
97
- iface = gr.Interface(
98
- fn=scrape_naver_blog,
99
- inputs=gr.Textbox(lines=2, placeholder="https://blog.naver.com/...", label="๋ธ”๋กœ๊ทธ URL"),
100
- outputs=[
101
- gr.Textbox(label="๊ฒฐ๊ณผ"),
102
- gr.Textbox(label="๋””๋ฒ„๊น… ์ •๋ณด")
103
- ],
104
- title=title,
105
- description=description,
106
- allow_flagging="never"
107
- )
108
-
109
- iface.launch()
 
 
 
 
 
90
 
91
  return f"{output_title}\n\n{output_content}", final_debug_info
92
 
93
+ except Exception as e:
94
+ # ์˜ˆ์™ธ ๋ฐœ์ƒ ์‹œ ์—๋Ÿฌ ๋ฉ”์‹œ์ง€์™€ ๋นˆ ๋””๋ฒ„๊น… ์ •๋ณด๋ฅผ ๋ฐ˜ํ™˜
95
+ return f"An error occurred: {str(e)}", ""
96
+
97
+ # Gradio ์ธํ„ฐํŽ˜์ด์Šค ๊ตฌ์„ฑ (ํ•จ์ˆ˜ ๋ฐ–์— ์œ„์น˜)
98
+ title = "๋„ค์ด๋ฒ„ ๋ธ”๋กœ๊ทธ ์Šคํฌ๋ž˜ํผ"
99
+ description = "๋„ค์ด๋ฒ„ ๋ธ”๋กœ๊ทธ URL์„ ์ž…๋ ฅํ•˜๋ฉด ์ œ๋ชฉ๊ณผ ๋‚ด์šฉ์„ ์Šคํฌ๋ž˜ํ•‘ํ•ฉ๋‹ˆ๋‹ค."
100
+
101
+ iface = gr.Interface(
102
+ fn=scrape_naver_blog,
103
+ inputs=gr.Textbox(lines=2, placeholder="https://blog.naver.com/...", label="๋ธ”๋กœ๊ทธ URL"),
104
+ outputs=[
105
+ gr.Textbox(label="๊ฒฐ๊ณผ"),
106
+ gr.Textbox(label="๋””๋ฒ„๊น… ์ •๋ณด")
107
+ ],
108
+ title=title,
109
+ description=description,
110
+ allow_flagging="never"
111
+ )
112
+
113
+ iface.launch()