Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -61,9 +61,10 @@ 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 =
|
67 |
DATA_FILENAME = "level2.json"
|
68 |
#DATA_FILE = os.path.join(DATASET_REPO_URL, DATA_FILENAME)
|
69 |
|
@@ -490,9 +491,11 @@ def main():
|
|
490 |
|
491 |
# Write JSON to file
|
492 |
#with open(DATA_FILE, 'w') as f: #w+
|
493 |
-
with
|
494 |
-
|
495 |
-
|
|
|
|
|
496 |
#json.dump(json_data, f)
|
497 |
#repo.push_to_hub()
|
498 |
# commit_url = repo.push_to_hub()
|
|
|
61 |
from datetime import datetime
|
62 |
import pathlib as Path
|
63 |
from requests import get
|
64 |
+
import urllib.request
|
65 |
|
66 |
|
67 |
+
DATASET_REPO_URL = "https://huggingface.co/datasets/Seetha/visual_files/raw/main/level2.json"
|
68 |
DATA_FILENAME = "level2.json"
|
69 |
#DATA_FILE = os.path.join(DATASET_REPO_URL, DATA_FILENAME)
|
70 |
|
|
|
491 |
|
492 |
# Write JSON to file
|
493 |
#with open(DATA_FILE, 'w') as f: #w+
|
494 |
+
with urllib.request.urlopen(DATASET_REPO_URL) as response:
|
495 |
+
data = response.read()
|
496 |
+
with open(DATASET_REPO_URL,'w') as f:
|
497 |
+
st.write(f)
|
498 |
+
f.write(json.dump(json_data))
|
499 |
#json.dump(json_data, f)
|
500 |
#repo.push_to_hub()
|
501 |
# commit_url = repo.push_to_hub()
|