seawolf2357 commited on
Commit
1e2fdfe
ยท
verified ยท
1 Parent(s): 1eb1070

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -21,24 +21,28 @@ def start_timer(url, interval):
21
  # Gradio UI ์ปดํฌ๋„ŒํŠธ๋ฅผ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค.
22
  url_input1 = gr.Text(label="URL 1", placeholder="์ ‘์†ํ•  ์ฒซ ๋ฒˆ์งธ URL์„ ์ž…๋ ฅํ•˜์„ธ์š”")
23
  url_input2 = gr.Text(label="URL 2", placeholder="์ ‘์†ํ•  ๋‘ ๋ฒˆ์งธ URL์„ ์ž…๋ ฅํ•˜์„ธ์š”")
 
 
24
  interval_input = gr.Slider(minimum=1, maximum=60, step=1, value=5, label="์ ‘์† ์ฃผ๊ธฐ(๋ถ„)")
25
 
26
  # ํƒ€์ด๋จธ ์‹œ์ž‘ ํ•จ์ˆ˜๋ฅผ Gradio์˜ ์ž…๋ ฅ๊ณผ ํ•จ๊ป˜ ์—ฐ๊ฒฐํ•ฉ๋‹ˆ๋‹ค.
27
- def setup_timer(url1, url2, interval):
28
  interval_seconds = interval * 60 # ๋ถ„์„ ์ดˆ๋กœ ๋ณ€ํ™˜
29
  start_timer(url1, interval_seconds)
30
  start_timer(url2, interval_seconds)
 
 
31
  return "ํƒ€์ด๋จธ๊ฐ€ ์„ค์ •๋˜์—ˆ์Šต๋‹ˆ๋‹ค."
32
 
33
  # Gradio ์•ฑ ์„ค์ •
34
  app = gr.Interface(
35
  fn=setup_timer,
36
- inputs=[url_input1, url_input2, interval_input],
37
  outputs="text",
38
  title="URL ์ ‘์† ์ฒด์ปค",
39
- description="๋‘ ๊ฐœ์˜ URL๊ณผ ์ ‘์† ์ฃผ๊ธฐ๋ฅผ ์ž…๋ ฅํ•˜๊ณ  '์‹œ์ž‘' ๋ฒ„ํŠผ์„ ํด๋ฆญํ•˜์„ธ์š”. ์ง€์ •๋œ ์ฃผ๊ธฐ๋กœ HTTP ์ƒํƒœ ์ฝ”๋“œ ๋ฐ ์ ‘์† ์ƒํƒœ๋ฅผ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.",
40
  examples=[
41
- ["https://seawolf2357-FastGPT.hf.space", "https://seawolf2357-NaverTalk.hf.space", 5]
42
  ]
43
  )
44
  app.launch(share=True)
 
21
  # Gradio UI ์ปดํฌ๋„ŒํŠธ๋ฅผ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค.
22
  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="๋„ค ๊ฐœ์˜ URL๊ณผ ์ ‘์† ์ฃผ๊ธฐ๋ฅผ ์ž…๋ ฅํ•˜๊ณ  '์‹œ์ž‘' ๋ฒ„ํŠผ์„ ํด๋ฆญํ•˜์„ธ์š”. ์ง€์ •๋œ ์ฃผ๊ธฐ๋กœ HTTP ์ƒํƒœ ์ฝ”๋“œ ๋ฐ ์ ‘์† ์ƒํƒœ๋ฅผ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.",
44
  examples=[
45
+ ["https://seawolf2357-FastGPT.hf.space", "https://seawolf2357-NaverTalk.hf.space", "https://seawolf2357-timer.hf.space", "https://seawolf2357-timer2.hf.space", 10]
46
  ]
47
  )
48
  app.launch(share=True)