Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support GLM Edge and ModernBERT #356

Merged
merged 5 commits into from
Dec 23, 2024
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion python/openvino_tokenizers/hf_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ def tokenization_model(self) -> None:
"TemplateProcessing": CombineSegmentsStep.from_hf_json_template_postprocessor,
"BertProcessing": CombineSegmentsStep.from_hf_json_bert_postprocessor,
"RobertaProcessing": CombineSegmentsStep.from_hf_json_roberta_processor,
"ByteLevel": lambda *args: list(), # return no handle for ByteLevel so add_steps skips it
}

def post_tokenization(self) -> None:
Expand Down Expand Up @@ -315,7 +316,7 @@ def post_tokenization(self) -> None:
post_processor_json, self.number_of_inputs, self.add_special_tokens
)

self.num_of_added_tokens += combine_segments_step.number_of_added_tokens
self.num_of_added_tokens += getattr(combine_segments_step, "number_of_added_tokens", 0)

self.add_truncation()
self.pipeline.add_steps(combine_segments_step)
Expand Down
Loading