-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automatically restart spaces if they're down (#2405)
* check and restart spaces that are down * if no auth_token, don't break build * add to changelog * Update CHANGELOG.md
- Loading branch information
Showing
3 changed files
with
17 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from upload_demos import demos_by_category, upload_demo_to_space, AUTH_TOKEN, gradio_version | ||
from gradio.networking import url_ok | ||
|
||
|
||
for category in demos_by_category: | ||
for demo in category["demos"]: | ||
space_id = "gradio/" + demo["dir"] | ||
if not url_ok(f"https://hf.space/embed/{space_id}/+"): | ||
print(f"{space_id} was down, restarting") | ||
upload_demo_to_space(demo_name=demo["dir"], space_id=space_id, hf_token=AUTH_TOKEN, gradio_version=gradio_version) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters