Spaces:
Runtime error
Runtime error
Update web.py
Browse files
web.py
CHANGED
|
@@ -17,18 +17,16 @@ async def periodic_update(live_block, interval=60):
|
|
| 17 |
|
| 18 |
def run_gradio():
|
| 19 |
""" Gradio ์น ์ธํฐํ์ด์ค๋ฅผ ์ค์ ํ๊ณ ์คํํฉ๋๋ค. """
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
demo = gr.Blocks()
|
| 23 |
-
|
| 24 |
-
with demo:
|
| 25 |
gr.Markdown("## Live Server Output")
|
| 26 |
-
live_block
|
| 27 |
-
|
| 28 |
-
|
|
|
|
| 29 |
|
| 30 |
# ๋น๋๊ธฐ ์
๋ฐ์ดํธ ์์
์์
|
| 31 |
-
asyncio.
|
|
|
|
| 32 |
|
| 33 |
if __name__ == "__main__":
|
| 34 |
run_gradio()
|
|
|
|
| 17 |
|
| 18 |
def run_gradio():
|
| 19 |
""" Gradio ์น ์ธํฐํ์ด์ค๋ฅผ ์ค์ ํ๊ณ ์คํํฉ๋๋ค. """
|
| 20 |
+
with gr.Blocks() as demo:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
gr.Markdown("## Live Server Output")
|
| 22 |
+
live_block = gr.Textbox(label="Live Output", value="Starting...", elem_id="live_output")
|
| 23 |
+
|
| 24 |
+
# Gradio ์๋ฒ ์์
|
| 25 |
+
demo.queue(concurrency_count=20).launch(server_name="0.0.0.0", server_port=7860, inbrowser=True)
|
| 26 |
|
| 27 |
# ๋น๋๊ธฐ ์
๋ฐ์ดํธ ์์
์์
|
| 28 |
+
loop = asyncio.get_event_loop()
|
| 29 |
+
loop.create_task(periodic_update(live_block))
|
| 30 |
|
| 31 |
if __name__ == "__main__":
|
| 32 |
run_gradio()
|