Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -5,10 +5,15 @@ import time
|
|
5 |
|
6 |
api = HfApi()
|
7 |
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
client_idefics2 = Client("HuggingFaceH4/idefics2-8b-playground")
|
14 |
client_idefics2_dpoed = Client("HuggingFaceH4/idefics2-8b-vdpoed-playground")
|
|
|
5 |
|
6 |
api = HfApi()
|
7 |
|
8 |
+
repo_ids = ["HuggingFaceH4/idefics2-8b-playground", "HuggingFaceH4/idefics2-8b-vdpoed-playground"]
|
9 |
+
|
10 |
+
for repo_id in repo_ids:
|
11 |
+
if api.space_info(repo_id).runtime.stage != "RUNNING":
|
12 |
+
api.restart_space(repo_id="HuggingFaceH4/idefics2-8b-playground")
|
13 |
+
|
14 |
+
for repo_id in repo_ids:
|
15 |
+
if api.space_info(repo_id).runtime.stage != "RUNNING":
|
16 |
+
time.sleep(1)
|
17 |
|
18 |
client_idefics2 = Client("HuggingFaceH4/idefics2-8b-playground")
|
19 |
client_idefics2_dpoed = Client("HuggingFaceH4/idefics2-8b-vdpoed-playground")
|