Skip to content

Commit

Permalink
Add poem instruction ds (#2813)
Browse files Browse the repository at this point in the history
I checked the poem instruction for empty strings, references and
appearances of "openai". As expected for a poem dataset, none of these
things was found.

---------

Co-authored-by: Andreas Köpf <andreas.koepf@provisio.com>
  • Loading branch information
CloseChoice and andreaskoepf committed Apr 21, 2023
1 parent ca58b0b commit b05fd9b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions model/model_training/custom_datasets/__init__.py
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
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
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

0 comments on commit b05fd9b

Please sign in to comment.