Redmind commited on
Commit
8430191
·
verified ·
1 Parent(s): e6dcd99

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -1223,7 +1223,9 @@ def create_file_HF(file_path):
1223
  #check if direcotry exists
1224
  dir_exists_flag = directory_exists(repo_id, directory, token)
1225
  if not dir_exists_flag:
1226
- file_path = directory + "/" + file_path
 
 
1227
  #if directory does not exist, create the directoty
1228
  login(token=os.getenv("HF_TOKEN"))
1229
  #create_branch("Redmind/NewageNXTGPT_Repo_trial", repo_type="space", branch="test-branch")
@@ -1231,7 +1233,7 @@ def create_file_HF(file_path):
1231
  #create_tag("bigcode/the-stack", repo_type="dataset", revision="v0.1-release", tag="v0.1.1", tag_message="Bump release version.")
1232
 
1233
 
1234
- api.upload_file(path_or_fileobj=file_path, repo_id="Redmind/NewageNXTGPT_Repo_trial",revision = "test-branch", repo_type= "space", path_in_repo=file_path)
1235
 
1236
 
1237
  def create_pdf(cname,ename,account_number):
 
1223
  #check if direcotry exists
1224
  dir_exists_flag = directory_exists(repo_id, directory, token)
1225
  if not dir_exists_flag:
1226
+ directory = directory + "/" + file_path
1227
+ else:
1228
+ directory = directory + "/" + file_path
1229
  #if directory does not exist, create the directoty
1230
  login(token=os.getenv("HF_TOKEN"))
1231
  #create_branch("Redmind/NewageNXTGPT_Repo_trial", repo_type="space", branch="test-branch")
 
1233
  #create_tag("bigcode/the-stack", repo_type="dataset", revision="v0.1-release", tag="v0.1.1", tag_message="Bump release version.")
1234
 
1235
 
1236
+ api.upload_file(path_or_fileobj=file_path, repo_id="Redmind/NewageNXTGPT_Repo_trial",revision = "test-branch", repo_type= "space", path_in_repo=directory)
1237
 
1238
 
1239
  def create_pdf(cname,ename,account_number):