Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ import json
|
|
4 |
import os
|
5 |
import tempfile
|
6 |
import shlex
|
7 |
-
from huggingface_hub import HfApi
|
8 |
|
9 |
from build_logic import (
|
10 |
_get_api_token as build_logic_get_api_token,
|
@@ -1281,12 +1281,6 @@ def handle_build_space_button(hf_api_key_ui, ui_space_name_part, ui_owner_name_p
|
|
1281 |
try:
|
1282 |
api.create_repo(repo_id=repo_id_target, repo_type="space", space_sdk=space_sdk_ui, private=is_private_ui, exist_ok=True)
|
1283 |
build_status_messages.append(f"CREATE_SPACE: Successfully created or ensured space [{repo_id_target}](https://huggingface.co/spaces/{repo_id_target}) exists.")
|
1284 |
-
except HfHubHTTPError as e_http:
|
1285 |
-
msg = f"CREATE_SPACE HTTP Error ({e_http.response.status_code if e_http.response else 'N/A'}): {e_http.response.text if e_http.response else str(e_http)}. Check logs."
|
1286 |
-
build_status_messages.append(msg)
|
1287 |
-
errors_occurred = True
|
1288 |
-
if e_http.response and e_http.response.status_code in (401, 403):
|
1289 |
-
_build_status = f"Build Error: {msg}. Cannot proceed with file upload."; yield ( gr.update(value=_build_status), gr.update(), gr.update(), gr.update(), gr.update(), gr.update(), gr.update(), gr.update(), gr.update(), gr.update(), gr.update(), gr.update(), gr.update(), gr.update() ); return
|
1290 |
except Exception as e:
|
1291 |
msg = f"CREATE_SPACE Error: {e}"
|
1292 |
build_status_messages.append(msg)
|
|
|
4 |
import os
|
5 |
import tempfile
|
6 |
import shlex
|
7 |
+
from huggingface_hub import HfApi
|
8 |
|
9 |
from build_logic import (
|
10 |
_get_api_token as build_logic_get_api_token,
|
|
|
1281 |
try:
|
1282 |
api.create_repo(repo_id=repo_id_target, repo_type="space", space_sdk=space_sdk_ui, private=is_private_ui, exist_ok=True)
|
1283 |
build_status_messages.append(f"CREATE_SPACE: Successfully created or ensured space [{repo_id_target}](https://huggingface.co/spaces/{repo_id_target}) exists.")
|
|
|
|
|
|
|
|
|
|
|
|
|
1284 |
except Exception as e:
|
1285 |
msg = f"CREATE_SPACE Error: {e}"
|
1286 |
build_status_messages.append(msg)
|