Skip to content

Commit

Permalink
Fix max token slicing
Browse files Browse the repository at this point in the history
  • Loading branch information
nikita-savelyevv committed Jul 24, 2024
1 parent 5d21486 commit 6f82e2b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llm_bench/python/utils/conversion_utils/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ def save_tokenizer(tokenizer, out_dir):

def transform_fn(item, item_name, input_shapes, tokenizer, config, max_tokens=127):
tokenized_text = tokenizer(item[item_name], return_tensors="np")
input_ids = tokenized_text["input_ids"][:max_tokens]
attention_mask = tokenized_text["attention_mask"][:max_tokens]
input_ids = tokenized_text["input_ids"][:, :max_tokens]
attention_mask = tokenized_text["attention_mask"][:, :max_tokens]

inputs = {}
inputs["input_ids"] = input_ids
Expand Down

0 comments on commit 6f82e2b

Please sign in to comment.