seawolf2357 commited on
Commit
d05cede
ยท
verified ยท
1 Parent(s): 377e71c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -19,7 +19,7 @@ def start_timer(url, interval):
19
  check_connection(url)
20
 
21
  # ํƒ€์ด๋จธ ์‹œ์ž‘ ํ•จ์ˆ˜๋ฅผ Gradio์˜ ์ž…๋ ฅ๊ณผ ํ•จ๊ป˜ ์—ฐ๊ฒฐํ•ฉ๋‹ˆ๋‹ค.
22
- def setup_timer(*urls, interval):
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=url_inputs + [interval_input],
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-test1.hf.space",
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 # ์บ์‹œ ๋น„ํ™œ์„ฑํ™”