Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -134,9 +134,15 @@ def build_space(repo_name,file_name,file_content,access_token=""):
|
|
| 134 |
try:
|
| 135 |
repo_path="broadfield/"+repo_name
|
| 136 |
#access_token=""
|
| 137 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 138 |
# Create a new Space
|
| 139 |
-
response =
|
| 140 |
space_info = response.json()
|
| 141 |
print(space_info)
|
| 142 |
space_id = space_info["name"]
|
|
|
|
| 134 |
try:
|
| 135 |
repo_path="broadfield/"+repo_name
|
| 136 |
#access_token=""
|
| 137 |
+
api=HfApi(endpoint="https://huggingface.co", token=access_token)
|
| 138 |
+
repo_url = api.create_repo(
|
| 139 |
+
repo_id=repo_path,
|
| 140 |
+
repo_type="space",
|
| 141 |
+
space_sdk="gradio",
|
| 142 |
+
private=False,
|
| 143 |
+
)
|
| 144 |
# Create a new Space
|
| 145 |
+
response = api.create_repo(repo_path)
|
| 146 |
space_info = response.json()
|
| 147 |
print(space_info)
|
| 148 |
space_id = space_info["name"]
|