Skip to content

Commit

Permalink
use max sequence length for tokenization
Browse files Browse the repository at this point in the history
  • Loading branch information
horheynm committed Aug 4, 2023
1 parent a674414 commit 7823c07
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/deepsparse/transformers/pipelines/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,11 @@ def create_pipeline_buckets(
:param kwargs: keyword args for pipeline creation
:return: A List[Pipeline] objects representing different buckets
"""
pipelines = []
for seq_len in sorted(sequence_length):
curr_pipeline = Pipeline.create(*args, sequence_length=seq_len, **kwargs)
pipelines.append(curr_pipeline)

return pipelines
max_seq_length = max(sequence_length)
return [
Pipeline.create(*args, sequence_length=max_seq_length, **kwargs)
for _ in range(len(sequence_length))
]

@staticmethod
def select_bucket_by_seq_len(
Expand Down

0 comments on commit 7823c07

Please sign in to comment.