Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -75,12 +75,13 @@ from datasets import load_dataset
|
|
75 |
import huggingface_hub
|
76 |
from huggingface_hub import Repository
|
77 |
from datetime import datetime
|
|
|
78 |
|
79 |
DATASET_REPO_URL = "https://huggingface.co/datasets/Seetha/visual_files"
|
80 |
DATA_FILENAME = "level2.json"
|
81 |
DATA_FILE = os.path.join("level2", DATA_FILENAME)
|
82 |
-
|
83 |
-
st.write(
|
84 |
|
85 |
HF_TOKEN = os.environ.get("HF_TOKEN")
|
86 |
|
@@ -510,7 +511,8 @@ def main():
|
|
510 |
#st.write(dataset)
|
511 |
|
512 |
# Write JSON to file
|
513 |
-
with open(
|
|
|
514 |
json.dump(json_data, f)
|
515 |
repo.push_to_hub()
|
516 |
# commit_url = repo.push_to_hub()
|
|
|
75 |
import huggingface_hub
|
76 |
from huggingface_hub import Repository
|
77 |
from datetime import datetime
|
78 |
+
from pathlib import path
|
79 |
|
80 |
DATASET_REPO_URL = "https://huggingface.co/datasets/Seetha/visual_files"
|
81 |
DATA_FILENAME = "level2.json"
|
82 |
DATA_FILE = os.path.join("level2", DATA_FILENAME)
|
83 |
+
DATA_pat = Path("https://huggingface.co/datasets/Seetha/visual_files") / f"level2.json"
|
84 |
+
st.write(DATA_pat)
|
85 |
|
86 |
HF_TOKEN = os.environ.get("HF_TOKEN")
|
87 |
|
|
|
511 |
#st.write(dataset)
|
512 |
|
513 |
# Write JSON to file
|
514 |
+
with open(DATA_pat, 'w') as f: #w+
|
515 |
+
st.write(f)
|
516 |
json.dump(json_data, f)
|
517 |
repo.push_to_hub()
|
518 |
# commit_url = repo.push_to_hub()
|