Skip to content

Commit

Permalink
Merge branch 'master' into date-obj-handling
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffkinnison committed Aug 16, 2023
2 parents 5b72965 + 090918d commit 63a1891
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ludwig/models/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ def generate(
input_ids_sample_no_padding = remove_left_padding(input_ids_sample, self.tokenizer)
logger.info(
"Decoded text inputs for the first example in batch: "
f"{self.tokenizer.decode(input_ids_sample_no_padding[0])}"
f"{self.tokenizer.decode(input_ids_sample_no_padding[0], skip_special_tokens=True)}"
)

if input_ids_sample_no_padding.shape[1] > self.max_input_length:
Expand All @@ -422,6 +422,10 @@ def generate(
return_dict_in_generate=True,
output_scores=True,
)
logger.info(
"Decoded generated output for the first example in batch: "
f"{self.tokenizer.batch_decode(model_outputs.sequences, skip_special_tokens=True)[0]}"
)

sequences_list.append(model_outputs.sequences[0])

Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ torch>=1.13.0
torchaudio
torchtext
torchvision
pydantic<2.0
transformers>=4.31.0
tokenizers>=0.13.3
spacy>=2.3
Expand Down

0 comments on commit 63a1891

Please sign in to comment.