Update app.py
Browse files79 unmodified lines808182838485868788899091929394959679 unmodified linesreturn html_table, tmp_file.name# Gradio ์ธํฐํ์ด์ค ์์ฑ (์ ๋ ฅ: ํ ์คํธ๋ฐ์ค, ์ถ๋ ฅ: HTML ํ ์ด๋ธ๊ณผ ์์ ๋ค์ด๋ก๋ ํ์ผ)iface = gr.Interface(fn=scrape_naver_news,inputs=gr.Textbox(label="ํค์๋๋ฅผ ์ ๋ ฅํ์ธ์"),outputs=[gr.HTML(label="๋ด์ค ๊ฒฐ๊ณผ"),gr.File(label="์์ ๋ค์ด๋ก๋")],title="๋ค์ด๋ฒ ๋ด์ค ์คํฌ๋ํ",description="ํค์๋๋ฅผ ์ ๋ ฅํ๋ฉด ๋ค์ด๋ฒ ๋ด์ค๋ฅผ ์คํฌ๋ํํ์ฌ ๊ฒฐ๊ณผ๋ฅผ ํ๋ก ๋ณด์ฌ์ฃผ๊ณ , ์์ ํ์ผ๋ก ๋ค์ด๋ก๋ํ ์ ์์ต๋๋ค.")if __name__ == "__main__":iface.launch()79 unmodified lines80818283848586878889909192939495969779 unmodified linesreturn html_table, tmp_file.name# Gradio Blocks๋ฅผ ์ด์ฉํ ๋ ์ด์์ ๊ตฌ์ฑ (์ถ๋ ฅ ๊ฒฐ๊ณผ๋ฅผ ์์ง์ผ๋ก ๋ฐฐ์น)with gr.Blocks() as demo:gr.Markdown("# ๋ค์ด๋ฒ ๋ด์ค ์คํฌ๋ํ")gr.Markdown("ํค์๋๋ฅผ ์ ๋ ฅํ๋ฉด ๋ค์ด๋ฒ ๋ด์ค๋ฅผ ์คํฌ๋ํํ์ฌ ๊ฒฐ๊ณผ๋ฅผ ํ๋ก ๋ณด์ฌ์ฃผ๊ณ , ์์ ํ์ผ๋ก ๋ค์ด๋ก๋ํ ์ ์์ต๋๋ค.")keyword = gr.Textbox(label="ํค์๋๋ฅผ ์ ๋ ฅํ์ธ์")btn = gr.Button("๊ฒ์")html_output = gr.HTML(label="๋ด์ค ๊ฒฐ๊ณผ")file_output = gr.File(label="์์ ๋ค์ด๋ก๋")btn.click(fn=scrape_naver_news, inputs=keyword, outputs=[html_output, file_output])if __name__ == "__main__":demo.launch()
app.py+13-12