Spaces:
Build error
Build error
Commit
·
4e61fdd
1
Parent(s):
3e317b0
- fix to output url
Browse files
app.py
CHANGED
|
@@ -57,7 +57,7 @@ class SpaceBuilder:
|
|
| 57 |
"""
|
| 58 |
name_list = cls.split_space_names(names)
|
| 59 |
create_repo(name=space_name, token=hf_token, repo_type="space", space_sdk="gradio")
|
| 60 |
-
|
| 61 |
|
| 62 |
try:
|
| 63 |
file_string = cls.file_as_a_string(name_list)
|
|
@@ -70,13 +70,14 @@ class SpaceBuilder:
|
|
| 70 |
return False
|
| 71 |
|
| 72 |
try:
|
| 73 |
-
|
| 74 |
path_or_fileobj="temp_file.txt",
|
| 75 |
path_in_repo="app.py",
|
| 76 |
-
repo_id=
|
| 77 |
repo_type="space",
|
| 78 |
token=hf_token,
|
| 79 |
)
|
|
|
|
| 80 |
return True
|
| 81 |
except Exception as ex:
|
| 82 |
print(ex)
|
|
|
|
| 57 |
"""
|
| 58 |
name_list = cls.split_space_names(names)
|
| 59 |
create_repo(name=space_name, token=hf_token, repo_type="space", space_sdk="gradio")
|
| 60 |
+
repo_name = get_full_repo_name(model_id=space_name, token=hf_token)
|
| 61 |
|
| 62 |
try:
|
| 63 |
file_string = cls.file_as_a_string(name_list)
|
|
|
|
| 70 |
return False
|
| 71 |
|
| 72 |
try:
|
| 73 |
+
file_url = upload_file(
|
| 74 |
path_or_fileobj="temp_file.txt",
|
| 75 |
path_in_repo="app.py",
|
| 76 |
+
repo_id=repo_name,
|
| 77 |
repo_type="space",
|
| 78 |
token=hf_token,
|
| 79 |
)
|
| 80 |
+
cls.url = f"https://huggingface.co/spaces/{repo_name}
|
| 81 |
return True
|
| 82 |
except Exception as ex:
|
| 83 |
print(ex)
|