Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,23 @@
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
css = """
|
4 |
-
footer {
|
5 |
-
|
|
|
|
|
|
|
|
|
|
|
6 |
}
|
|
|
|
|
7 |
"""
|
8 |
|
9 |
def create_home_screen():
|
@@ -48,23 +62,134 @@ def create_home_screen():
|
|
48 |
|
49 |
gr.Markdown("## \n")
|
50 |
|
51 |
-
# Discord iframe as another column
|
52 |
-
with gr.Row():
|
53 |
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
"""
|
58 |
-
|
59 |
-
|
60 |
-
gr.Markdown("""
|
61 |
-
### ๋์ค์ฝ๋ ์๋ฒ ์ฐธ์ฌ
|
62 |
-
๐ค ๋์ค์ฝ๋ ์๋ฒ์ ์ฐธ์ฌํ๋ฉด ๋์ฑ ๋ค์ํ 90์ข
์ด์์ AI ์๋น์ค๋ฅผ ๋ง๋ ์ ์์ต๋๋ค. \n
|
63 |
-
๐ค ์ข์ธก ํ๋ฉด ํ๋จ "Join Discord"๋ฅผ ํด๋ฆญํ์ธ์. \n
|
64 |
-
""")
|
65 |
return home
|
66 |
|
67 |
-
if __name__ == "__main__":
|
68 |
-
home = create_home_screen()
|
69 |
-
home.launch()
|
70 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
+
import requests
|
3 |
+
import logging
|
4 |
+
import threading
|
5 |
+
import time
|
6 |
+
|
7 |
+
# ๋ก๊น
์ค์
|
8 |
+
logging.basicConfig(level=logging.INFO)
|
9 |
|
10 |
css = """
|
11 |
+
footer { visibility: hidden; }
|
12 |
+
.status-button {
|
13 |
+
display: inline-block;
|
14 |
+
padding: 5px 10px;
|
15 |
+
margin: 5px;
|
16 |
+
border-radius: 5px;
|
17 |
+
font-size: 12px;
|
18 |
}
|
19 |
+
.status-normal { background-color: green; color: white; }
|
20 |
+
.status-abnormal { background-color: red; color: white; }
|
21 |
"""
|
22 |
|
23 |
def create_home_screen():
|
|
|
62 |
|
63 |
gr.Markdown("## \n")
|
64 |
|
|
|
|
|
65 |
|
66 |
+
|
67 |
+
# with gr.Column(scale=1):
|
68 |
+
# gr.HTML("""
|
69 |
+
# <iframe src="https://discord.com/widget?id=1228254992729767996&theme=dark" width="350" height="500" allowtransparency="true" frameborder="0" sandbox="allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts"></iframe>
|
70 |
+
# """)
|
71 |
+
|
|
|
|
|
|
|
|
|
|
|
72 |
return home
|
73 |
|
|
|
|
|
|
|
74 |
|
75 |
+
|
76 |
+
|
77 |
+
# ๋ชจ๋ํฐ๋ง ๋์ ๋ชฉ๋ก
|
78 |
+
TARGETS = [
|
79 |
+
{"name": "[H100]AI ๊ฐ์ธ๋น์ JinJAVIS", "url": "http://hugpu.ai:8000"},
|
80 |
+
{"name": "[H100]ํตํฉ Medim ๋ธ๋ก๊ทธ ์์คํ
", "url": "http://hugpu.ai:7917"},
|
81 |
+
|
82 |
+
{"name": "[HUGPU]๊ด๋ฆฌ-HOME", "url": "https://seawolf2357-bnews1.hf.space"},
|
83 |
+
{"name": "[HUGPU]๊ด๋ฆฌ-H100 LIST", "url": "https://seawolf2357-bnews2.hf.space"},
|
84 |
+
{"name": "[HUGPU]๊ด๋ฆฌ-MONITOR Origin", "url": "https://seawolf2357-bnews3.hf.space"},
|
85 |
+
|
86 |
+
{"name": "[HUGPU]๊ด๋ฆฌ-MONITOR Cross", "url": "https://seawolf2357-bnews4.hf.space"}, # ๋ชจ๋ํฐ์ค๋ฆฌ์ง ๊ฐ์ ์ค์ ํ์
|
87 |
+
|
88 |
+
{"name": "[HUGPU]FLUX ํ์ฅ ์ด๋ฏธ์ง ์์ฑ", "url": "https://fantaxy-ofai-flx-expl-store.hf.space"},
|
89 |
+
{"name": "[HUGPU]FLUX GIF ์์ฑ", "url": "https://aiqtech-flxgif.hf.space"},
|
90 |
+
{"name": "[HUGPU]LOGO ๋์์ธ ์์ฑ ", "url": "https://fantaxy-ofai-flx-logo.hf.space"},
|
91 |
+
{"name": "[HUGPU]FLUX ํ๋กฌํํธ ์์ฑ ", "url": "https://ginipick-flux-prompt-generator.hf.space"},
|
92 |
+
{"name": "[HUGPU]ํ๋กฌํํธ+์ด๋ฏธ์ง๋ก ์ด๋ฏธ์ง ์์ฑ ", "url": "https://fantaxy-kolors-ipadapter.hf.space"}, ##์๋ชป๋ URL: INDEX.HTML๋ ์์ ํ ๊ฒ
|
93 |
+
{"name": "[HUGPU]LoRA: ๊ธฐ๋ธ๋ฆฌ ์คํ์ผ ", "url": "https://aiqtech-flux-ghibli-studio-lora.hf.space"},
|
94 |
+
{"name": "[HUGPU]LoRA: ์นดํฐ ์คํ์ผ ", "url": "https://aiqtech-flxani.hf.space"},
|
95 |
+
{"name": "[HUGPU]FLUX 8step LoRA ์ด๋ฏธ์ง ์์ฑ ", "url": "https://fantos-flx8lora.hf.space"},
|
96 |
+
{"name": "[HUGPU]FLUX ํ
์คํธ TO ๋น๋์ค ์์ฑ ", "url": "https://fantos-cogvidx.hf.space"},
|
97 |
+
{"name": "[HUGPU]FLUX ํจ์
๋ชจ๋ธ ์์ฑ ", "url": "https://fantos-flxfashmodel.hf.space"},
|
98 |
+
{"name": "[HUGPU]FLUX Controlnet ", "url": "https://fantos-flxcontrol.hf.space"},
|
99 |
+
{"name": "[HUGPU]FLUX NF4 ์ด๋ฏธ์ง ์์ฑ ", "url": "https://ginipick-ofai-flxnf4.hf.space"},
|
100 |
+
|
101 |
+
{"name": "[HUGPU]์ด๋ฏธ์ง์ ํ๊ธ ํ๋กฌํํธ๋ก ์์ ์์ฑ I ", "url": "https://fantaxy-ofai-it2v2.hf.space"},
|
102 |
+
{"name": "[HUGPU]์ด๋ฏธ์ง์ ํ๊ธ ํ๋กฌํํธ๋ก ์์ ์์ฑ II ", "url": "https://aiqtech-cinevid.hf.space"},
|
103 |
+
{"name": "[HUGPU]์ํ ์ฌ์ง ์
๋ก๋+ํ๋กฌํํธ๋ก ๋ฐฐ๊ฒฝ์ ํฉ์ฑ ", "url": "https://aiqtech-producbrmg.hf.space"},
|
104 |
+
{"name": "[HUGPU]ํ
์คํธ๋ก ์ด๋ฏธ์ง ์์ฑ: Accracy ๋ชจ๋ธ ", "url": "https://ginipick-accdiffusion.hf.space"},
|
105 |
+
{"name": "[HUGPU]ํ
์คํธ๋ก ์ด๋ฏธ์ง ์์ฑ: Playground ๋ชจ๋ธ ", "url": "https://fantaxy-playground25.hf.space"},
|
106 |
+
{"name": "[HUGPU]ํ
์คํธ๋ก ์ด๋ฏธ์ง ์์ฑ: AuraFlow ๋ชจ๋ธ ", "url": "https://fantaxy-auroflow-v3.hf.space"},
|
107 |
+
{"name": "[HUGPU]EveryText: ๋ชจ๋ ๋ฌธ์๊ฐ ์ด๋ฏธ์ง ์์ฑ์ ๋ฐ์ ", "url": "https://fantos-EveryText.hf.space"},
|
108 |
+
{"name": "[HUGPU]๋ด ์ผ๊ตด ์ฌ์ง์ผ๋ก ์ด๋ฏธ์ง ์์ฑ ", "url": "https://aiqtech-kofaceid.hf.space"},
|
109 |
+
|
110 |
+
{"name": "[HUGPU]๋น๋์ค ์ธ์ QnA ์ฑ๋ด ", "url": "https://ginipick-vidiqa.hf.space"},
|
111 |
+
{"name": "[HUGPU]์ด๋ฏธ์ง ์ค์ผ์ผ์
(ํ์ง๊ฐ์ ) ", "url": "https://ginipick-finegrain-image-enhancer.hf.space"},
|
112 |
+
{"name": "[HUGPU]์ด๋ฏธ์ง ๋ฐฐ๊ฒฝ ์ ๊ฑฐ ", "url": "https://ginipick-background-removal.hf.space"},
|
113 |
+
{"name": "[HUGPU]๋น๋์ค ๋ฐฐ๊ฒฝ ์ ๊ฑฐ ", "url": "https://fantaxy-remove-video-background.hf.space"},
|
114 |
+
{"name": "[HUGPU]ํ
์คํธ ์
๋ ฅ์ผ๋ก ์์
์์ฑ ", "url": "https://fantaxy-stable-audio-open-zero.hf.space"},
|
115 |
+
|
116 |
+
{"name": "[HUGPU]MS PHI 3.5 Vision ", "url": "https://aiqtech-phi35-vision.hf.space"},
|
117 |
+
{"name": "[HUGPU]NSFW kAI ", "url": "https://fantaxy-ofai-kai.hf.space"},
|
118 |
+
{"name": "[HUGPU]๋ฉํ LLAMA 3.1 405B ", "url": "https://seawolf2357-ofai-405.hf.space"},
|
119 |
+
{"name": "[HUGPU]๋ฉํ LLAMA 3.1 70B ", "url": "https://fantaxy-ofai-70.hf.space"},
|
120 |
+
{"name": "[HUGPU]๋ฉํ LLAMA 3.1 8B ", "url": "https://seawolf2357-ofai-8.hf.space"},
|
121 |
+
{"name": "[HUGPU]๋ฏธ์คํธ๋ 7B Instruct v0.3 ", "url": "https://fantaxy-ofai-mis7b.hf.space"},
|
122 |
+
{"name": "[HUGPU]MS Phi 3 mini 4k-instruct ", "url": "https://fantaxy-ofai-phi.hf.space"},
|
123 |
+
{"name": "[HUGPU]์ค๊ตญ Yi 1.5 34B ", "url": "https://fantaxy-ofai-yi.hf.space"},
|
124 |
+
{"name": "[HUGPU]๋ฏธ์คํธ๋ Mixtral 8X7B ", "url": "https://fantaxy-ofai-8x7b.hf.space"},
|
125 |
+
{"name": "[HUGPU]๋ฏธ์คํธ๋ Nemo Instruct 2407 ", "url": "https://seawolf2357-ofai-mistral-nemo.hf.space"},
|
126 |
+
|
127 |
+
{"name": "[HUGPU]๋ธ๋ก๊ทธ ์๋(์ปจํ/๋จ์) ์์ฑ ", "url": "https://fantaxy-blogger-send-webhook-confirm-image.hf.space"},
|
128 |
+
{"name": "[HUGPU]๋ธ๋ก๊ทธ ์๋(๋ฌด์ธ/๋ณต์) ์์ฑ ", "url": "https://fantaxy-blogger-send-webhook-auto-image.hf.space"},
|
129 |
+
|
130 |
+
{"name": "[HUGPU]์ ๋ฌธ ๋ธ๋ก๊ทธ ์์ฑ ", "url": "https://seawolf2357-ofai-jinjavis-blog.hf.space"},
|
131 |
+
{"name": "[HUGPU]์ํ ์ ๋ฌธ ๋ธ๋ก๊ทธ ์์ฑ ", "url": "https://seawolf2357-ofai-jinjavis-blog-medi.hf.space"},
|
132 |
+
{"name": "[HUGPU]์ฝ๋ฆฌํ ์ ๋ฌธ ๋ธ๋ก๊ทธ ์์ฑ ", "url": "https://seawolf2357-ofai-jinjavis-blog-pharm.hf.space"},
|
133 |
+
|
134 |
+
{"name": "[HUGPU]ํ์ด๋จธ1-1 ", "url": "https://seawolf2357-timer.hf.space"},
|
135 |
+
{"name": "[HUGPU]ํ์ด๋จธ1-2 ", "url": "https://seawolf2357-timer2.hf.space"},
|
136 |
+
{"name": "[HUGPU]ํ์ด๋จธ1-3 ", "url": "https://seawolf2357-timer3.hf.space"},
|
137 |
+
{"name": "[HUGPU]ํ์ด๋จธ1-4 ", "url": "https://seawolf2357-timer4.hf.space"},
|
138 |
+
{"name": "[HUGPU]ํ์ด๋จธ2-1 ", "url": "https://fantaxy-timer1.hf.space"},
|
139 |
+
{"name": "[HUGPU]ํ์ด๋จธ2-2 ", "url": "https://fantaxy-timer2.hf.space"},
|
140 |
+
]
|
141 |
+
|
142 |
+
|
143 |
+
# URL ์ํ ํ์ธ ํจ์
|
144 |
+
def check_url_status(url):
|
145 |
+
try:
|
146 |
+
response = requests.get(url, timeout=5)
|
147 |
+
if response.status_code == 200:
|
148 |
+
logging.info(f"URL ์ ์ ์ฑ๊ณต: {url}")
|
149 |
+
return "์ ์", "normal"
|
150 |
+
else:
|
151 |
+
logging.error(f"URL ์ ์ ์ค๋ฅ: {url}, ์ํ ์ฝ๋ {response.status_code}")
|
152 |
+
return "๋น์ ์", "abnormal"
|
153 |
+
except requests.exceptions.RequestException as e:
|
154 |
+
logging.exception(f"์๋ฒ์ ์ฐ๊ฒฐํ ์ ์์ต๋๋ค: {url}")
|
155 |
+
return "๋น์ ์", "abnormal"
|
156 |
+
|
157 |
+
# ์ํ ์
๋ฐ์ดํธ ํจ์
|
158 |
+
def update_status():
|
159 |
+
status_html = ""
|
160 |
+
for target in TARGETS:
|
161 |
+
status, status_class = check_url_status(target["url"])
|
162 |
+
status_html += f'<span class="status-button status-{status_class}">{target["name"]}: {status}</span>'
|
163 |
+
return status_html
|
164 |
+
|
165 |
+
# ์ฃผ๊ธฐ์ ์
๋ฐ์ดํธ๋ฅผ ์ํ ํจ์
|
166 |
+
def periodic_update(status_html):
|
167 |
+
while True:
|
168 |
+
time.sleep(60) # 10์ด ๋๊ธฐ
|
169 |
+
new_status = update_status()
|
170 |
+
status_html.update(value=new_status)
|
171 |
+
|
172 |
+
# Gradio ์ธํฐํ์ด์ค ์ค์
|
173 |
+
def create_dashboard():
|
174 |
+
with gr.Blocks(css=css) as app:
|
175 |
+
gr.Image("banner.png", show_label=False)
|
176 |
+
gr.Markdown("# 24์๊ฐ ๋ชจ๋ํฐ๋ง ์์คํ
")
|
177 |
+
gr.Markdown("## \n")
|
178 |
+
|
179 |
+
status_html = gr.HTML()
|
180 |
+
|
181 |
+
refresh_button = gr.Button("์ํ ์๋ก๊ณ ์นจ")
|
182 |
+
refresh_button.click(fn=update_status, outputs=status_html)
|
183 |
+
|
184 |
+
# ์ด๊ธฐ ์ํ ์
๋ฐ์ดํธ
|
185 |
+
app.load(fn=update_status, outputs=status_html)
|
186 |
+
|
187 |
+
# ๋ฐฑ๊ทธ๋ผ์ด๋์์ ์ฃผ๊ธฐ์ ์
๋ฐ์ดํธ ์์
|
188 |
+
threading.Thread(target=periodic_update, args=(status_html,), daemon=True).start()
|
189 |
+
|
190 |
+
return app
|
191 |
+
|
192 |
+
|
193 |
+
if __name__ == "__main__":
|
194 |
+
dashboard = create_dashboard()
|
195 |
+
dashboard.launch()
|