Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,14 @@
|
|
1 |
import gradio as gr
|
2 |
from gradio_client import Client, handle_file
|
|
|
|
|
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
client_idefics2 = Client("HuggingFaceH4/idefics2-8b-playground")
|
6 |
client_idefics2_dpoed = Client("HuggingFaceH4/idefics2-8b-vdpoed-playground")
|
|
|
1 |
import gradio as gr
|
2 |
from gradio_client import Client, handle_file
|
3 |
+
from huggingface_hub import HfApi
|
4 |
+
import time
|
5 |
|
6 |
+
api = HfApi()
|
7 |
+
|
8 |
+
api.restart_space(repo_id="HuggingFaceH4/idefics2-8b-playground")
|
9 |
+
api.restart_space(repo_id="HuggingFaceH4/idefics2-8b-vdpoed-playground")
|
10 |
+
while api.space_info("HuggingFaceH4/idefics2-8b-playground").runtime.stage != "RUNNING" or api.space_info("HuggingFaceH4/idefics2-8b-vdpoed-playground").runtime.stage != "RUNNING":
|
11 |
+
time.sleep(1)
|
12 |
|
13 |
client_idefics2 = Client("HuggingFaceH4/idefics2-8b-playground")
|
14 |
client_idefics2_dpoed = Client("HuggingFaceH4/idefics2-8b-vdpoed-playground")
|