Spaces:
Runtime error
Runtime error
Austin Stockbridge commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -127,7 +127,7 @@ def merge(yaml_config: str, hf_token: str, repo_name: str) -> Iterable[List[Log]
|
|
| 127 |
|
| 128 |
is_community_model = False
|
| 129 |
if not hf_token:
|
| 130 |
-
if "/" in repo_name and not repo_name.startswith("
|
| 131 |
yield runner.log(
|
| 132 |
f"Cannot upload merge model to namespace {repo_name.split('/')[0]}: you must provide a valid token.",
|
| 133 |
level="ERROR",
|
|
@@ -158,8 +158,8 @@ def merge(yaml_config: str, hf_token: str, repo_name: str) -> Iterable[List[Log]
|
|
| 158 |
repo_name += "-" + "".join(random.choices(string.ascii_lowercase, k=7))
|
| 159 |
repo_name = repo_name.replace("/", "-").strip("-")
|
| 160 |
|
| 161 |
-
if is_community_model and not repo_name.startswith("
|
| 162 |
-
repo_name = f"
|
| 163 |
|
| 164 |
try:
|
| 165 |
yield runner.log(f"Creating repo {repo_name}")
|
|
@@ -190,7 +190,7 @@ def merge(yaml_config: str, hf_token: str, repo_name: str) -> Iterable[List[Log]
|
|
| 190 |
|
| 191 |
# This is workaround. As the space always getting stuck.
|
| 192 |
def _restart_space():
|
| 193 |
-
huggingface_hub.HfApi().restart_space(repo_id="
|
| 194 |
# Run garbage collection every hour to keep the community org clean.
|
| 195 |
# Empty models might exists if the merge fails abruptly (e.g. if user leaves the Space).
|
| 196 |
def _garbage_remover():
|
|
|
|
| 127 |
|
| 128 |
is_community_model = False
|
| 129 |
if not hf_token:
|
| 130 |
+
if "/" in repo_name and not repo_name.startswith("stupidity-ai/"):
|
| 131 |
yield runner.log(
|
| 132 |
f"Cannot upload merge model to namespace {repo_name.split('/')[0]}: you must provide a valid token.",
|
| 133 |
level="ERROR",
|
|
|
|
| 158 |
repo_name += "-" + "".join(random.choices(string.ascii_lowercase, k=7))
|
| 159 |
repo_name = repo_name.replace("/", "-").strip("-")
|
| 160 |
|
| 161 |
+
if is_community_model and not repo_name.startswith("stupidity-ai/"):
|
| 162 |
+
repo_name = f"stupidity-ai/{repo_name}"
|
| 163 |
|
| 164 |
try:
|
| 165 |
yield runner.log(f"Creating repo {repo_name}")
|
|
|
|
| 190 |
|
| 191 |
# This is workaround. As the space always getting stuck.
|
| 192 |
def _restart_space():
|
| 193 |
+
huggingface_hub.HfApi().restart_space(repo_id="Austinkeith2010/MergekitGUI-butitmakesmelookactive", token=COMMUNITY_HF_TOKEN, factory_reboot=False)
|
| 194 |
# Run garbage collection every hour to keep the community org clean.
|
| 195 |
# Empty models might exists if the merge fails abruptly (e.g. if user leaves the Space).
|
| 196 |
def _garbage_remover():
|