Redmind commited on
Commit
2653c86
·
verified ·
1 Parent(s): 81f9db7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -1181,6 +1181,8 @@ def handle_large_dataset(df, create_document,isDataFrame):
1181
 
1182
  file_path = os.path.join(current_folder, 'output_data.xlsx')
1183
  df.to_excel(file_path, index=False)
 
 
1184
  files = os.listdir(current_folder)
1185
  print(f"Files in persistent storage: {files}")
1186
  print(f"The current folder is: {current_folder}")
@@ -1207,12 +1209,12 @@ def handle_large_dataset(df, create_document,isDataFrame):
1207
  login(token=os.getenv("HF_TOKEN"))
1208
  from huggingface_hub import HfApi
1209
  api = HfApi()
1210
- api.upload_file(path_or_fileobj=file_path, repo_id=repo_id, repo_type= "space", path_in_repo="data/output.xlsx")
1211
 
1212
  from huggingface_hub import hf_hub_url
1213
 
1214
  print(hf_hub_url(
1215
- repo_id="Redmind/NewageNXTGPT", filename="data/output.xlsx"
1216
  ))
1217
 
1218
  #print(f"Download the file here: {download_url}")
@@ -1255,10 +1257,10 @@ def create_pdf(name,id):
1255
  output.write(filled.read())
1256
 
1257
  repo_id = "Redmind/NewageNXTGPT"
1258
- file_output=f"data/{output_file_name}"
1259
  from huggingface_hub import HfApi
1260
  api = HfApi()
1261
- api.upload_file(path_or_fileobj=output_file_name, repo_id=repo_id, repo_type= "space", path_in_repo=file_output)
1262
  return f"{output_file_name} is created successfully."
1263
 
1264
 
 
1181
 
1182
  file_path = os.path.join(current_folder, 'output_data.xlsx')
1183
  df.to_excel(file_path, index=False)
1184
+ df.to_excel('/persistent/output_data.xlsx', index=False)
1185
+
1186
  files = os.listdir(current_folder)
1187
  print(f"Files in persistent storage: {files}")
1188
  print(f"The current folder is: {current_folder}")
 
1209
  login(token=os.getenv("HF_TOKEN"))
1210
  from huggingface_hub import HfApi
1211
  api = HfApi()
1212
+ #api.upload_file(path_or_fileobj=file_path, repo_id=repo_id, repo_type= "space", path_in_repo="static/output.xlsx")
1213
 
1214
  from huggingface_hub import hf_hub_url
1215
 
1216
  print(hf_hub_url(
1217
+ repo_id="Redmind/NewageNXTGPT", filename="static/output.xlsx"
1218
  ))
1219
 
1220
  #print(f"Download the file here: {download_url}")
 
1257
  output.write(filled.read())
1258
 
1259
  repo_id = "Redmind/NewageNXTGPT"
1260
+ file_output=f"static/{output_file_name}"
1261
  from huggingface_hub import HfApi
1262
  api = HfApi()
1263
+ #api.upload_file(path_or_fileobj=output_file_name, repo_id=repo_id, repo_type= "space", path_in_repo=file_output)
1264
  return f"{output_file_name} is created successfully."
1265
 
1266