Spaces:
Running
Running
pragnakalp
commited on
Commit
·
eec34b9
1
Parent(s):
6c61cfb
Update app.py
Browse files
app.py
CHANGED
@@ -33,16 +33,17 @@ HF_TOKEN = os.environ.get("HF_TOKEN")
|
|
33 |
DATASET_REPO_ID = "pragnakalp/OCR-img-to-text"
|
34 |
print("is none?", HF_TOKEN is None)
|
35 |
try:
|
|
|
|
|
|
|
|
|
36 |
hf_hub_download(
|
37 |
repo_id=DATASET_REPO_ID,
|
38 |
filename=DATA_FILENAME,
|
39 |
cache_dir=DATA_DIRNAME,
|
40 |
force_filename=DATA_FILENAME
|
41 |
)
|
42 |
-
|
43 |
-
print("filename",filename)
|
44 |
-
print("cache_dir",cache_dir)
|
45 |
-
print("force_filename",force_filename)
|
46 |
except:
|
47 |
print("file not found")
|
48 |
|
@@ -142,8 +143,7 @@ def generate_ocr(Method,img):
|
|
142 |
writer = csv.writer(f)
|
143 |
# write the data
|
144 |
writer.writerow(add_csv)
|
145 |
-
|
146 |
-
# commit_url = repo.push_to_hub()
|
147 |
print(commit_url)
|
148 |
dataset = load_dataset("pragnakalp/OCR-img-to-text")
|
149 |
print("dataset*****************",dataset)
|
|
|
33 |
DATASET_REPO_ID = "pragnakalp/OCR-img-to-text"
|
34 |
print("is none?", HF_TOKEN is None)
|
35 |
try:
|
36 |
+
print("repo_id",DATASET_REPO_ID)
|
37 |
+
print("filename",DATA_FILENAME)
|
38 |
+
print("cache_dir",DATA_DIRNAME)
|
39 |
+
print("force_filename",DATA_FILENAME)
|
40 |
hf_hub_download(
|
41 |
repo_id=DATASET_REPO_ID,
|
42 |
filename=DATA_FILENAME,
|
43 |
cache_dir=DATA_DIRNAME,
|
44 |
force_filename=DATA_FILENAME
|
45 |
)
|
46 |
+
|
|
|
|
|
|
|
47 |
except:
|
48 |
print("file not found")
|
49 |
|
|
|
143 |
writer = csv.writer(f)
|
144 |
# write the data
|
145 |
writer.writerow(add_csv)
|
146 |
+
commit_url = repo.push_to_hub()
|
|
|
147 |
print(commit_url)
|
148 |
dataset = load_dataset("pragnakalp/OCR-img-to-text")
|
149 |
print("dataset*****************",dataset)
|