Seetha commited on
Commit
20004ed
·
1 Parent(s): eae1e5f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -482,7 +482,7 @@ def main():
482
  })
483
 
484
  # Write JSON to file
485
- with open('ch.json', 'w') as f:
486
  json.dump(json_data, f)
487
  # repo.git_pull()
488
  # repo.git_add("ch.json")
@@ -490,7 +490,7 @@ def main():
490
  # repo.push()
491
 
492
  csv_file = "predictions.csv"
493
- json_file = "smalljson.json"
494
 
495
  # Open the CSV file and read the data
496
  with open(csv_file, "r") as f:
@@ -505,11 +505,11 @@ def main():
505
  json_data = json.dumps(data_list)
506
 
507
  # Write the JSON data to a file
508
- with open(json_file, "r+") as f:
509
- data = f.read()
510
- f.seek(0)
511
- f.write(json_data)
512
- f.truncate()
513
  # api.upload_file(
514
  # path_or_fileobj=json_data,
515
  # path_in_repo="ch.json",
 
482
  })
483
 
484
  # Write JSON to file
485
+ with open('ch.json', 'w+') as f:
486
  json.dump(json_data, f)
487
  # repo.git_pull()
488
  # repo.git_add("ch.json")
 
490
  # repo.push()
491
 
492
  csv_file = "predictions.csv"
493
+ #json_file = "smalljson.json"
494
 
495
  # Open the CSV file and read the data
496
  with open(csv_file, "r") as f:
 
505
  json_data = json.dumps(data_list)
506
 
507
  # Write the JSON data to a file
508
+ with open("smalljson.json", "w+") as fi:
509
+ #data = f.read()
510
+ #f.seek(0)
511
+ fi.write(json_data)
512
+ #f.truncate()
513
  # api.upload_file(
514
  # path_or_fileobj=json_data,
515
  # path_in_repo="ch.json",