Spaces:
Running
Running
pragnakalp
commited on
Commit
•
dc96bf4
1
Parent(s):
d14fa80
Update save_data.py
Browse files- save_data.py +11 -0
save_data.py
CHANGED
@@ -17,6 +17,17 @@ REPOSITORY_DIR = "data"
|
|
17 |
LOCAL_DIR = 'data_local'
|
18 |
os.makedirs(LOCAL_DIR,exist_ok=True)
|
19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
repo = Repository(
|
21 |
local_dir="ocr_data", clone_from=DATASET_REPO_URL, use_auth_token=HF_TOKEN
|
22 |
)
|
|
|
17 |
LOCAL_DIR = 'data_local'
|
18 |
os.makedirs(LOCAL_DIR,exist_ok=True)
|
19 |
|
20 |
+
try:
|
21 |
+
hf_hub_download(
|
22 |
+
repo_id=DATASET_REPO_ID,
|
23 |
+
filename=DATA_FILENAME,
|
24 |
+
cache_dir=DATA_DIRNAME,
|
25 |
+
force_filename=DATA_FILENAME
|
26 |
+
)
|
27 |
+
|
28 |
+
except:
|
29 |
+
print("file not found")
|
30 |
+
|
31 |
repo = Repository(
|
32 |
local_dir="ocr_data", clone_from=DATASET_REPO_URL, use_auth_token=HF_TOKEN
|
33 |
)
|