Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -19,7 +19,7 @@ def start_timer(url, interval):
|
|
19 |
check_connection(url)
|
20 |
|
21 |
# ํ์ด๋จธ ์์ ํจ์๋ฅผ Gradio์ ์
๋ ฅ๊ณผ ํจ๊ป ์ฐ๊ฒฐํฉ๋๋ค.
|
22 |
-
def setup_timer(*urls
|
23 |
interval_seconds = interval * 60 # ๋ถ์ ์ด๋ก ๋ณํ
|
24 |
for url in urls:
|
25 |
if url: # URL์ด ๋น์ด ์์ง ์์ผ๋ฉด ํ์ด๋จธ ์์
|
@@ -33,12 +33,13 @@ interval_input = gr.Slider(minimum=1, maximum=60, step=1, value=5, label="์ ์
|
|
33 |
# Gradio ์ฑ ์ค์
|
34 |
app = gr.Interface(
|
35 |
fn=setup_timer,
|
36 |
-
inputs=
|
37 |
outputs="text",
|
38 |
title="URL ์ ์ ์ฒด์ปค",
|
39 |
description="์ต๋ ์ค๋ฌด ๊ฐ์ URL๊ณผ ์ ์ ์ฃผ๊ธฐ๋ฅผ ์
๋ ฅํ๊ณ '์์' ๋ฒํผ์ ํด๋ฆญํ์ธ์. ์ง์ ๋ ์ฃผ๊ธฐ๋ก HTTP ์ํ ์ฝ๋ ๋ฐ ์ ์ ์ํ๋ฅผ ํ์ธํฉ๋๋ค.",
|
40 |
examples=[
|
41 |
[
|
|
|
42 |
"https://seawolf2357-FastGPT.hf.space",
|
43 |
"https://seawolf2357-NaverTalk.hf.space",
|
44 |
"https://seawolf2357-timer.hf.space",
|
@@ -49,7 +50,7 @@ app = gr.Interface(
|
|
49 |
"https://seawolf2357-kai-grandma.hf.space",
|
50 |
"https://seawolf2357-kai-simsime.hf.space",
|
51 |
"https://seawolf2357-kai-blog.hf.space",
|
52 |
-
"https://seawolf2357-
|
53 |
"https://seawolf2357-test2.hf.space",
|
54 |
"https://seawolf2357-test3.hf.space",
|
55 |
"https://seawolf2357-test4.hf.space",
|
@@ -58,8 +59,7 @@ app = gr.Interface(
|
|
58 |
"https://seawolf2357-test7.hf.space",
|
59 |
"https://seawolf2357-test8.hf.space",
|
60 |
"https://seawolf2357-test9.hf.space",
|
61 |
-
"https://seawolf2357-test10.hf.space"
|
62 |
-
15
|
63 |
]
|
64 |
],
|
65 |
cache_examples=False # ์บ์ ๋นํ์ฑํ
|
|
|
19 |
check_connection(url)
|
20 |
|
21 |
# ํ์ด๋จธ ์์ ํจ์๋ฅผ Gradio์ ์
๋ ฅ๊ณผ ํจ๊ป ์ฐ๊ฒฐํฉ๋๋ค.
|
22 |
+
def setup_timer(interval, *urls):
|
23 |
interval_seconds = interval * 60 # ๋ถ์ ์ด๋ก ๋ณํ
|
24 |
for url in urls:
|
25 |
if url: # URL์ด ๋น์ด ์์ง ์์ผ๋ฉด ํ์ด๋จธ ์์
|
|
|
33 |
# Gradio ์ฑ ์ค์
|
34 |
app = gr.Interface(
|
35 |
fn=setup_timer,
|
36 |
+
inputs=[interval_input] + url_inputs,
|
37 |
outputs="text",
|
38 |
title="URL ์ ์ ์ฒด์ปค",
|
39 |
description="์ต๋ ์ค๋ฌด ๊ฐ์ URL๊ณผ ์ ์ ์ฃผ๊ธฐ๋ฅผ ์
๋ ฅํ๊ณ '์์' ๋ฒํผ์ ํด๋ฆญํ์ธ์. ์ง์ ๋ ์ฃผ๊ธฐ๋ก HTTP ์ํ ์ฝ๋ ๋ฐ ์ ์ ์ํ๋ฅผ ํ์ธํฉ๋๋ค.",
|
40 |
examples=[
|
41 |
[
|
42 |
+
15,
|
43 |
"https://seawolf2357-FastGPT.hf.space",
|
44 |
"https://seawolf2357-NaverTalk.hf.space",
|
45 |
"https://seawolf2357-timer.hf.space",
|
|
|
50 |
"https://seawolf2357-kai-grandma.hf.space",
|
51 |
"https://seawolf2357-kai-simsime.hf.space",
|
52 |
"https://seawolf2357-kai-blog.hf.space",
|
53 |
+
"https://seawolf2357-kai-anak.hf.space",
|
54 |
"https://seawolf2357-test2.hf.space",
|
55 |
"https://seawolf2357-test3.hf.space",
|
56 |
"https://seawolf2357-test4.hf.space",
|
|
|
59 |
"https://seawolf2357-test7.hf.space",
|
60 |
"https://seawolf2357-test8.hf.space",
|
61 |
"https://seawolf2357-test9.hf.space",
|
62 |
+
"https://seawolf2357-test10.hf.space"
|
|
|
63 |
]
|
64 |
],
|
65 |
cache_examples=False # ์บ์ ๋นํ์ฑํ
|