broadfield commited on
Commit
5d1a17f
·
verified ·
1 Parent(s): e0dc876

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -155,11 +155,11 @@ 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
- client.upload_file(local_file_path, repo_id=repo_path, path=file_name, commit_message=commit_message)
159
  print("File uploaded successfully.")
160
  # Commit changes
161
  commit_message += "\nInitial commit to the repository."+ local_file_path
162
- client.commit_repo(space_id, message=commit_message)
163
  return [{'role':'assistant','content': commit_message+'\nCommit Success' }]
164
  except Exception as e:
165
  print("ERROR ",e)
 
155
  f.close()
156
  # Upload a local file to the Space
157
  commit_message = "Adding file test: "+str(uuid.uuid4())
158
+ api.upload_file(local_file_path, repo_id=repo_path, path=file_name, commit_message=commit_message)
159
  print("File uploaded successfully.")
160
  # Commit changes
161
  commit_message += "\nInitial commit to the repository."+ local_file_path
162
+ api.commit_repo(space_id, message=commit_message)
163
  return [{'role':'assistant','content': commit_message+'\nCommit Success' }]
164
  except Exception as e:
165
  print("ERROR ",e)