Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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(
|
509 |
-
data = f.read()
|
510 |
-
f.seek(0)
|
511 |
-
|
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",
|