Skip to content

to support 2D input for tokenizer of genai reranker #2949

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

Open
wants to merge 1 commit into
base: latest
Choose a base branch
from

Conversation

openvino-dev-samples
Copy link
Collaborator

No description provided.

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

" optimum_cli(rerank_model_configuration[\"model_id\"], str(rerank_model_id.value), show_command=False, additional_args={\"task\": \"text-classificaton\"})"
" optimum_cli(rerank_model_configuration[\"model_id\"], str(rerank_model_id.value), show_command=False, additional_args={\"task\": \"text-classificaton\"})\n",
" hf_tokenizer = AutoTokenizer.from_pretrained(rerank_model_configuration[\"model_id\"], trust_remote_code=True)\n",
" ov_tokenizer, ov_detokenizer = convert_tokenizer(hf_tokenizer, with_detokenizer=True, number_of_inputs=2)\n",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@openvino-dev-samples , I've asked advice @pavel-esir and @apaniukov regarding how to better resolve second input addition in tokenizer. There is no need to complete tokenizer conversion: detokenizer remains the same, for converted tokenizer you can apply helper function from openvino tokenizers library https://github.com/openvinotoolkit/openvino_tokenizers/blob/master/python/openvino_tokenizers/tokenizer_transformations.py#L281

Copy link
Collaborator Author

@openvino-dev-samples openvino-dev-samples May 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My method is provided by @pavel-esir, could you suggest an official solution on this case ? thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants