Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -15,7 +15,14 @@ is_shared_ui = False
|
|
15 |
available_property = False if is_shared_ui else True
|
16 |
|
17 |
is_gpu_associated = torch.cuda.is_available()
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
def stream_output(pipe):
|
21 |
for line in iter(pipe.readline, ''):
|
@@ -216,6 +223,9 @@ div#warning-ready {
|
|
216 |
div#warning-ready > .gr-prose > h2, div#warning-ready > .gr-prose > p {
|
217 |
color: #057857!important;
|
218 |
}
|
|
|
|
|
|
|
219 |
"""
|
220 |
with gr.Blocks(css=css) as demo:
|
221 |
with gr.Column():
|
@@ -243,7 +253,7 @@ with gr.Blocks(css=css) as demo:
|
|
243 |
top_description = gr.HTML(f'''
|
244 |
<div class="gr-prose">
|
245 |
<h2 class="custom-color"><svg xmlns="http://www.w3.org/2000/svg" width="18px" height="18px" style="margin-right: 0px;display: inline-block;"fill="none"><path fill="#fff" d="M7 13.2a6.3 6.3 0 0 0 4.4-10.7A6.3 6.3 0 0 0 .6 6.9 6.3 6.3 0 0 0 7 13.2Z"/><path fill="#fff" fill-rule="evenodd" d="M7 0a6.9 6.9 0 0 1 4.8 11.8A6.9 6.9 0 0 1 0 7 6.9 6.9 0 0 1 7 0Zm0 0v.7V0ZM0 7h.6H0Zm7 6.8v-.6.6ZM13.7 7h-.6.6ZM9.1 1.7c-.7-.3-1.4-.4-2.2-.4a5.6 5.6 0 0 0-4 1.6 5.6 5.6 0 0 0-1.6 4 5.6 5.6 0 0 0 1.6 4 5.6 5.6 0 0 0 4 1.7 5.6 5.6 0 0 0 4-1.7 5.6 5.6 0 0 0 1.7-4 5.6 5.6 0 0 0-1.7-4c-.5-.5-1.1-.9-1.8-1.2Z" clip-rule="evenodd"/><path fill="#000" fill-rule="evenodd" d="M7 2.9a.8.8 0 1 1 0 1.5A.8.8 0 0 1 7 3ZM5.8 5.7c0-.4.3-.6.6-.6h.7c.3 0 .6.2.6.6v3.7h.5a.6.6 0 0 1 0 1.3H6a.6.6 0 0 1 0-1.3h.4v-3a.6.6 0 0 1-.6-.7Z" clip-rule="evenodd"/></svg>
|
246 |
-
You have successfully associated a {
|
247 |
<p class="custom-color">
|
248 |
You will be billed by the minute from when you activated the GPU until when it is turned off.
|
249 |
</p>
|
|
|
15 |
available_property = False if is_shared_ui else True
|
16 |
|
17 |
is_gpu_associated = torch.cuda.is_available()
|
18 |
+
if is_gpu_associated:
|
19 |
+
gpu_info = getoutput('nvidia-smi')
|
20 |
+
if("A10G" in gpu_info):
|
21 |
+
which_gpu = "A10G"
|
22 |
+
elif("T4" in gpu_info):
|
23 |
+
which_gpu = "T4"
|
24 |
+
else:
|
25 |
+
which_gpu = "CPU"
|
26 |
|
27 |
def stream_output(pipe):
|
28 |
for line in iter(pipe.readline, ''):
|
|
|
223 |
div#warning-ready > .gr-prose > h2, div#warning-ready > .gr-prose > p {
|
224 |
color: #057857!important;
|
225 |
}
|
226 |
+
.custom-color {
|
227 |
+
color: #030303 !important;
|
228 |
+
}
|
229 |
"""
|
230 |
with gr.Blocks(css=css) as demo:
|
231 |
with gr.Column():
|
|
|
253 |
top_description = gr.HTML(f'''
|
254 |
<div class="gr-prose">
|
255 |
<h2 class="custom-color"><svg xmlns="http://www.w3.org/2000/svg" width="18px" height="18px" style="margin-right: 0px;display: inline-block;"fill="none"><path fill="#fff" d="M7 13.2a6.3 6.3 0 0 0 4.4-10.7A6.3 6.3 0 0 0 .6 6.9 6.3 6.3 0 0 0 7 13.2Z"/><path fill="#fff" fill-rule="evenodd" d="M7 0a6.9 6.9 0 0 1 4.8 11.8A6.9 6.9 0 0 1 0 7 6.9 6.9 0 0 1 7 0Zm0 0v.7V0ZM0 7h.6H0Zm7 6.8v-.6.6ZM13.7 7h-.6.6ZM9.1 1.7c-.7-.3-1.4-.4-2.2-.4a5.6 5.6 0 0 0-4 1.6 5.6 5.6 0 0 0-1.6 4 5.6 5.6 0 0 0 1.6 4 5.6 5.6 0 0 0 4 1.7 5.6 5.6 0 0 0 4-1.7 5.6 5.6 0 0 0 1.7-4 5.6 5.6 0 0 0-1.7-4c-.5-.5-1.1-.9-1.8-1.2Z" clip-rule="evenodd"/><path fill="#000" fill-rule="evenodd" d="M7 2.9a.8.8 0 1 1 0 1.5A.8.8 0 0 1 7 3ZM5.8 5.7c0-.4.3-.6.6-.6h.7c.3 0 .6.2.6.6v3.7h.5a.6.6 0 0 1 0 1.3H6a.6.6 0 0 1 0-1.3h.4v-3a.6.6 0 0 1-.6-.7Z" clip-rule="evenodd"/></svg>
|
256 |
+
You have successfully associated a {which_gpu} GPU to the MimicMotion Space 🎉</h2>
|
257 |
<p class="custom-color">
|
258 |
You will be billed by the minute from when you activated the GPU until when it is turned off.
|
259 |
</p>
|