Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hjh0119 committed Aug 7, 2024
1 parent ac2b2a7 commit 47e08f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion swift/llm/sft.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def llm_sft(args: SftArguments) -> Dict[str, Any]:
dataset_info['val_dataset'] = stat_dataset(val_dataset) if not streaming else None
else:
dataset_info = None
td0, tkwargs0 = template.encode(train_dataset[0]) if streaming else next(iter(train_dataset)), {}
td0, tkwargs0 = template.encode(train_dataset[0])
print_example(td0, tokenizer, tkwargs0)
train_dataset = LazyLLMDataset(train_dataset, template)
if val_dataset is not None:
Expand Down
2 changes: 1 addition & 1 deletion swift/llm/utils/argument.py
Original file line number Diff line number Diff line change
Expand Up @@ -1032,7 +1032,7 @@ def __post_init__(self) -> None:
self.gradient_accumulation_steps = math.ceil(16 / self.batch_size / self.world_size)
template_info = TEMPLATE_MAPPING[self.template_type]
self._handle_streaming_args()
if self.lazy_tokenize is None:
if self.lazy_tokenize is None and not self.streaming:
self.lazy_tokenize = template_info.get('lazy_tokenize', False)
logger.info(f'Setting args.lazy_tokenize: {self.lazy_tokenize}')
if self.dataloader_num_workers is None:
Expand Down

0 comments on commit 47e08f3

Please sign in to comment.