Datasets:
alexandreteles
commited on
Commit
•
9e543b6
1
Parent(s):
162045f
fix merged files
Browse files- merged.jsonl → hermes-toth.json +0 -0
- merged.md → hermes-toth.md +0 -0
- merge.py +6 -4
merged.jsonl → hermes-toth.json
RENAMED
The diff for this file is too large to render.
See raw diff
|
|
merged.md → hermes-toth.md
RENAMED
File without changes
|
merge.py
CHANGED
@@ -4,8 +4,10 @@ import tiktoken
|
|
4 |
|
5 |
encoding = tiktoken.get_encoding("cl100k_base")
|
6 |
|
7 |
-
merged_md_file_path = "
|
8 |
-
merged_jsonl_file_path = "
|
|
|
|
|
9 |
|
10 |
|
11 |
def merge_to_md():
|
@@ -16,7 +18,7 @@ def merge_to_md():
|
|
16 |
first_file = True
|
17 |
for root, _, files in os.walk("."):
|
18 |
for file in files:
|
19 |
-
if file.endswith(".md") and file
|
20 |
print(f"Merging file: {file} into {merged_md_file_path}")
|
21 |
file_path = os.path.join(root, file)
|
22 |
with open(file_path, "r", encoding="utf-8") as f:
|
@@ -35,7 +37,7 @@ def merge_to_jsonl():
|
|
35 |
first_file = True
|
36 |
for root, _, files in os.walk("."):
|
37 |
for file in files:
|
38 |
-
if file.endswith(".md"):
|
39 |
print(f"Merging file: {file} into {merged_jsonl_file_path}")
|
40 |
file_path = os.path.join(root, file)
|
41 |
with open(file_path, "r", encoding="utf-8") as f:
|
|
|
4 |
|
5 |
encoding = tiktoken.get_encoding("cl100k_base")
|
6 |
|
7 |
+
merged_md_file_path = "hermes-toth.md"
|
8 |
+
merged_jsonl_file_path = "hermes-toth.json"
|
9 |
+
|
10 |
+
excluded = ("hermes-toth.md", "README.md")
|
11 |
|
12 |
|
13 |
def merge_to_md():
|
|
|
18 |
first_file = True
|
19 |
for root, _, files in os.walk("."):
|
20 |
for file in files:
|
21 |
+
if file.endswith(".md") and file not in excluded:
|
22 |
print(f"Merging file: {file} into {merged_md_file_path}")
|
23 |
file_path = os.path.join(root, file)
|
24 |
with open(file_path, "r", encoding="utf-8") as f:
|
|
|
37 |
first_file = True
|
38 |
for root, _, files in os.walk("."):
|
39 |
for file in files:
|
40 |
+
if file.endswith(".md") and file not in excluded:
|
41 |
print(f"Merging file: {file} into {merged_jsonl_file_path}")
|
42 |
file_path = os.path.join(root, file)
|
43 |
with open(file_path, "r", encoding="utf-8") as f:
|