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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -5
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="๋„ค ๊ฐœ์˜ 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)
 
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()