hsuwill000 commited on
Commit
2c42c67
·
verified ·
1 Parent(s): 46685b7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
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 == 'SLEEPING':
77
- print(f"{repo} is now SLEEPING.")
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
- break
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)