Skip to content

Commit

Permalink
fix Llama2Template and update style
Browse files Browse the repository at this point in the history
  • Loading branch information
AlongWY committed Dec 26, 2024
1 parent 33fee7d commit e86c3a4
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/llamafactory/data/data_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

from datasets import DatasetDict, concatenate_datasets, interleave_datasets

from .parser import DatasetAttr

from ..extras import logging


Expand Down
1 change: 1 addition & 0 deletions src/llamafactory/data/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ def _encode(
"""
system = system or self.default_system
encoded_messages = []
messages = continuous_messages(messages)
for i, message in enumerate(messages):
elements = []

Expand Down
3 changes: 1 addition & 2 deletions src/llamafactory/hparams/data_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@ class DataArguments:
metadata={"help": "Enable sequence packing without cross-attention."},
)
allow_truncation: bool = field(
default=False,
metadata={"help": "Allow truncation when processing supervised examples."}
default=False, metadata={"help": "Allow truncation when processing supervised examples."}
)
tool_format: Optional[str] = field(
default=None,
Expand Down

0 comments on commit e86c3a4

Please sign in to comment.