Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -23,26 +23,30 @@ url_input1 = gr.Text(label="URL 1", placeholder="์ ์ํ ์ฒซ ๋ฒ์งธ URL์ ์
|
|
23 |
url_input2 = gr.Text(label="URL 2", placeholder="์ ์ํ ๋ ๋ฒ์งธ URL์ ์
๋ ฅํ์ธ์")
|
24 |
url_input3 = gr.Text(label="URL 3", placeholder="์ ์ํ ์ธ ๋ฒ์งธ URL์ ์
๋ ฅํ์ธ์")
|
25 |
url_input4 = gr.Text(label="URL 4", placeholder="์ ์ํ ๋ค ๋ฒ์งธ URL์ ์
๋ ฅํ์ธ์")
|
|
|
|
|
26 |
interval_input = gr.Slider(minimum=1, maximum=60, step=1, value=5, label="์ ์ ์ฃผ๊ธฐ(๋ถ)")
|
27 |
|
28 |
# ํ์ด๋จธ ์์ ํจ์๋ฅผ Gradio์ ์
๋ ฅ๊ณผ ํจ๊ป ์ฐ๊ฒฐํฉ๋๋ค.
|
29 |
-
def setup_timer(url1, url2, url3, url4, interval):
|
30 |
interval_seconds = interval * 60 # ๋ถ์ ์ด๋ก ๋ณํ
|
31 |
start_timer(url1, interval_seconds)
|
32 |
start_timer(url2, interval_seconds)
|
33 |
start_timer(url3, interval_seconds)
|
34 |
start_timer(url4, interval_seconds)
|
|
|
|
|
35 |
return "ํ์ด๋จธ๊ฐ ์ค์ ๋์์ต๋๋ค."
|
36 |
|
37 |
# Gradio ์ฑ ์ค์
|
38 |
app = gr.Interface(
|
39 |
fn=setup_timer,
|
40 |
-
inputs=[url_input1, url_input2, url_input3, url_input4, interval_input],
|
41 |
outputs="text",
|
42 |
title="URL ์ ์ ์ฒด์ปค",
|
43 |
-
description="
|
44 |
examples=[
|
45 |
-
["https://seawolf2357-FastGPT.hf.space", "https://seawolf2357-NaverTalk.hf.space", "https://seawolf2357-timer.hf.space", "https://seawolf2357-timer2.hf.space",
|
46 |
]
|
47 |
)
|
48 |
-
app.launch(
|
|
|
23 |
url_input2 = gr.Text(label="URL 2", placeholder="์ ์ํ ๋ ๋ฒ์งธ URL์ ์
๋ ฅํ์ธ์")
|
24 |
url_input3 = gr.Text(label="URL 3", placeholder="์ ์ํ ์ธ ๋ฒ์งธ URL์ ์
๋ ฅํ์ธ์")
|
25 |
url_input4 = gr.Text(label="URL 4", placeholder="์ ์ํ ๋ค ๋ฒ์งธ URL์ ์
๋ ฅํ์ธ์")
|
26 |
+
url_input5 = gr.Text(label="URL 5", placeholder="์ ์ํ ๋ค์ฏ ๋ฒ์งธ URL์ ์
๋ ฅํ์ธ์")
|
27 |
+
url_input6 = gr.Text(label="URL 6", placeholder="์ ์ํ ์ฌ์ฏ ๋ฒ์งธ URL์ ์
๋ ฅํ์ธ์")
|
28 |
interval_input = gr.Slider(minimum=1, maximum=60, step=1, value=5, label="์ ์ ์ฃผ๊ธฐ(๋ถ)")
|
29 |
|
30 |
# ํ์ด๋จธ ์์ ํจ์๋ฅผ Gradio์ ์
๋ ฅ๊ณผ ํจ๊ป ์ฐ๊ฒฐํฉ๋๋ค.
|
31 |
+
def setup_timer(url1, url2, url3, url4, url5, url6, interval):
|
32 |
interval_seconds = interval * 60 # ๋ถ์ ์ด๋ก ๋ณํ
|
33 |
start_timer(url1, interval_seconds)
|
34 |
start_timer(url2, interval_seconds)
|
35 |
start_timer(url3, interval_seconds)
|
36 |
start_timer(url4, interval_seconds)
|
37 |
+
start_timer(url5, interval_seconds)
|
38 |
+
start_timer(url6, interval_seconds)
|
39 |
return "ํ์ด๋จธ๊ฐ ์ค์ ๋์์ต๋๋ค."
|
40 |
|
41 |
# Gradio ์ฑ ์ค์
|
42 |
app = gr.Interface(
|
43 |
fn=setup_timer,
|
44 |
+
inputs=[url_input1, url_input2, url_input3, url_input4, url_input5, url_input6, interval_input],
|
45 |
outputs="text",
|
46 |
title="URL ์ ์ ์ฒด์ปค",
|
47 |
+
description="์ฌ์ฏ ๊ฐ์ URL๊ณผ ์ ์ ์ฃผ๊ธฐ๋ฅผ ์
๋ ฅํ๊ณ '์์' ๋ฒํผ์ ํด๋ฆญํ์ธ์. ์ง์ ๋ ์ฃผ๊ธฐ๋ก HTTP ์ํ ์ฝ๋ ๋ฐ ์ ์ ์ํ๋ฅผ ํ์ธํฉ๋๋ค.",
|
48 |
examples=[
|
49 |
+
["https://seawolf2357-FastGPT.hf.space", "https://seawolf2357-NaverTalk.hf.space", "https://seawolf2357-timer.hf.space", "https://seawolf2357-timer2.hf.space", "https://seawolf2357-apisch.hf.space", "https://seawolf2357-apislm.hf.space", 15]
|
50 |
]
|
51 |
)
|
52 |
+
app.launch()
|