Datasets:
Guillaume Raille
commited on
change dataset path
Browse files- data/{tiny-moliere.txt → tinymoliere.txt} +0 -0
- main.py +4 -4
data/{tiny-moliere.txt → tinymoliere.txt}
RENAMED
|
File without changes
|
main.py
CHANGED
|
@@ -75,9 +75,9 @@ def main():
|
|
| 75 |
else:
|
| 76 |
print(f"{filename} already exists, skipping download.")
|
| 77 |
|
| 78 |
-
# overwrite
|
| 79 |
-
if (DATA_DIR / "
|
| 80 |
-
(DATA_DIR / "
|
| 81 |
|
| 82 |
# process each PDF and write into a .txt file
|
| 83 |
for path in paths:
|
|
@@ -96,7 +96,7 @@ def main():
|
|
| 96 |
# we ignore the last page
|
| 97 |
for page in doc[toc_end:-1]:
|
| 98 |
page_text = page.get_text(clip=new_rect)
|
| 99 |
-
with open(DATA_DIR / "
|
| 100 |
f.write(page_text)
|
| 101 |
|
| 102 |
|
|
|
|
| 75 |
else:
|
| 76 |
print(f"{filename} already exists, skipping download.")
|
| 77 |
|
| 78 |
+
# overwrite tinymoliere.txt if it exists
|
| 79 |
+
if (DATA_DIR / "tinymoliere.txt").exists():
|
| 80 |
+
(DATA_DIR / "tinymoliere.txt").unlink()
|
| 81 |
|
| 82 |
# process each PDF and write into a .txt file
|
| 83 |
for path in paths:
|
|
|
|
| 96 |
# we ignore the last page
|
| 97 |
for page in doc[toc_end:-1]:
|
| 98 |
page_text = page.get_text(clip=new_rect)
|
| 99 |
+
with open(DATA_DIR / "tinymoliere.txt", "a") as f:
|
| 100 |
f.write(page_text)
|
| 101 |
|
| 102 |
|