Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -155,7 +155,8 @@ def build_space(repo_name,file_name,file_content,access_token=""):
|
|
| 155 |
f.close()
|
| 156 |
# Upload a local file to the Space
|
| 157 |
commit_message = "Adding file test: "+str(uuid.uuid4())
|
| 158 |
-
|
|
|
|
| 159 |
print("File uploaded successfully.")
|
| 160 |
# Commit changes
|
| 161 |
commit_message += "\nInitial commit to the repository."+ local_file_path
|
|
|
|
| 155 |
f.close()
|
| 156 |
# Upload a local file to the Space
|
| 157 |
commit_message = "Adding file test: "+str(uuid.uuid4())
|
| 158 |
+
|
| 159 |
+
api.upload_file(path_or_fileobj=local_file_path, path_in_repo=file_name, repo_id=repo_path, repo_type='space', commit_message=commit_message)
|
| 160 |
print("File uploaded successfully.")
|
| 161 |
# Commit changes
|
| 162 |
commit_message += "\nInitial commit to the repository."+ local_file_path
|