mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-06-24 17:31:18 +08:00
LoRA: pre-commit fix
This commit is contained in:
parent
30b39c7115
commit
b94b7e0fe7
@ -55,10 +55,7 @@ class ToolsDataset(Dataset):
|
|||||||
messages = self._data[idx]["messages"]
|
messages = self._data[idx]["messages"]
|
||||||
tools = self._data[idx]["tools"]
|
tools = self._data[idx]["tools"]
|
||||||
text = self._tokenizer.apply_chat_template(
|
text = self._tokenizer.apply_chat_template(
|
||||||
messages,
|
messages, tools=tools, tokenize=False, add_generation_prompt=True
|
||||||
tools=tools,
|
|
||||||
tokenize=False,
|
|
||||||
add_generation_prompt=True
|
|
||||||
)
|
)
|
||||||
return text
|
return text
|
||||||
|
|
||||||
@ -144,9 +141,7 @@ def create_hf_dataset(args, tokenizer: PreTrainedTokenizer):
|
|||||||
**hf_args.get("config", {}),
|
**hf_args.get("config", {}),
|
||||||
)
|
)
|
||||||
if prompt_feature and completion_feature:
|
if prompt_feature and completion_feature:
|
||||||
return CompletionsDataset(
|
return CompletionsDataset(ds, tokenizer, prompt_feature, completion_feature)
|
||||||
ds, tokenizer, prompt_feature, completion_feature
|
|
||||||
)
|
|
||||||
elif text_feature:
|
elif text_feature:
|
||||||
return Dataset(train_ds, text_key=text_feature)
|
return Dataset(train_ds, text_key=text_feature)
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user