Update app.py
Browse files
app.py
CHANGED
@@ -73,13 +73,12 @@ async def infer_gradio(prompt: str):
|
|
73 |
tasks = []
|
74 |
for repo in repos:
|
75 |
runtime_info = api.get_space_runtime(repo)
|
76 |
-
if runtime_info.stage == '
|
77 |
-
|
78 |
-
api.restart_space(repo_id=repo)
|
79 |
if runtime_info.stage in ['SLEEPING', 'PAUSED']:
|
80 |
print(f"{repo} is now SLEEPING or PAUSED.")
|
81 |
api.restart_space(repo_id=repo)
|
82 |
-
|
83 |
# Create a CustomClient instance for each repo
|
84 |
client = CustomClient(repo, hf_token=api_key, timeout=300)
|
85 |
task = infer_single_gradio(client, prompt)
|
|
|
73 |
tasks = []
|
74 |
for repo in repos:
|
75 |
runtime_info = api.get_space_runtime(repo)
|
76 |
+
if runtime_info.stage == 'APP_STARTING':
|
77 |
+
continue
|
|
|
78 |
if runtime_info.stage in ['SLEEPING', 'PAUSED']:
|
79 |
print(f"{repo} is now SLEEPING or PAUSED.")
|
80 |
api.restart_space(repo_id=repo)
|
81 |
+
continue
|
82 |
# Create a CustomClient instance for each repo
|
83 |
client = CustomClient(repo, hf_token=api_key, timeout=300)
|
84 |
task = infer_single_gradio(client, prompt)
|