Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add poem instruction ds #2813

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions model/model_training/custom_datasets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@ def get_one_dataset(
elif dataset_name == "hellaswag":
train, eval = load_hellaswag()
elif dataset_name == "dolly15k":
dataset = DatabricksDolly15k(cache_dir=data_path)
dataset = DatabricksDolly15k(cache_dir=data_path, mode=mode, **kwargs)
elif dataset_name == "alpaca_gpt4":
dataset = AlpacaGpt4(cache_dir=data_path, **kwargs)
dataset = AlpacaGpt4(cache_dir=data_path, mode=mode, **kwargs)
else:
raise ValueError(f"Unknown dataset {dataset_name}")

Expand Down
1 change: 1 addition & 0 deletions model/model_training/custom_datasets/instruction.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"zhihu-kol": "wangrui6/zhihu-kol",
"minimath": "kentsui/minimath",
"oa_wiki_qa_bart_10000row": "michaelthwan/oa_wiki_qa_bart_10000row",
"poem_instructions": "checkai/instruction-poems",
}


Expand Down
3 changes: 3 additions & 0 deletions model/model_training/custom_datasets/qa_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
# @agoryuno contributed this
re_reference_remove = re.compile(r"\[\d+(?:,\s*\d+)*?\]")
re_single_reference_remove = re.compile(r"\[\s?\d+\s?\]")

# check if the whole string is just a combination of (multiple) whitespaces and newlines
re_whitespace_newline_match = re.compile(r"^[\s\n]*$")


Expand Down Expand Up @@ -450,6 +452,7 @@ def process_split(
dataset: Subset, reverse_augmentation: bool = False, keep_unreversed: bool = True
) -> list[tuple[str, str]]:
data = []

for row in dataset:
question = row["instruction"]
if len(row["input"]) > 0:
Expand Down