Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -60,14 +60,15 @@ import huggingface_hub
|
|
60 |
from huggingface_hub import Repository
|
61 |
from datetime import datetime
|
62 |
import pathlib as Path
|
|
|
63 |
|
64 |
|
65 |
-
DATASET_REPO_URL = "https://huggingface.co/datasets/Seetha/visual_files/raw/main"
|
66 |
DATA_FILENAME = "level2.json"
|
67 |
DATA_FILE = os.path.join(DATASET_REPO_URL, DATA_FILENAME)
|
68 |
|
69 |
# feedback_file = Path("https://huggingface.co/datasets/Seetha/visual_files/") / f"level2.json"
|
70 |
-
|
71 |
|
72 |
HF_TOKEN = os.environ.get("HF_TOKEN")
|
73 |
|
@@ -489,7 +490,7 @@ def main():
|
|
489 |
|
490 |
# Write JSON to file
|
491 |
#with open(DATA_FILE, 'w') as f: #w+
|
492 |
-
with open(
|
493 |
st.write(f)
|
494 |
f.write(json.dump(json_data))
|
495 |
#json.dump(json_data, f)
|
|
|
60 |
from huggingface_hub import Repository
|
61 |
from datetime import datetime
|
62 |
import pathlib as Path
|
63 |
+
from requests import get
|
64 |
|
65 |
|
66 |
+
DATASET_REPO_URL = get("https://huggingface.co/datasets/Seetha/visual_files/raw/main/level2.json")
|
67 |
DATA_FILENAME = "level2.json"
|
68 |
DATA_FILE = os.path.join(DATASET_REPO_URL, DATA_FILENAME)
|
69 |
|
70 |
# feedback_file = Path("https://huggingface.co/datasets/Seetha/visual_files/") / f"level2.json"
|
71 |
+
st.write(DATASET_REPO_URL)
|
72 |
|
73 |
HF_TOKEN = os.environ.get("HF_TOKEN")
|
74 |
|
|
|
490 |
|
491 |
# Write JSON to file
|
492 |
#with open(DATA_FILE, 'w') as f: #w+
|
493 |
+
with open(DATASET_REPO_URL,'w') as f:
|
494 |
st.write(f)
|
495 |
f.write(json.dump(json_data))
|
496 |
#json.dump(json_data, f)
|