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

apply_chat_template C API design in tokenizer #906

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

apply_chat_template C API design in tokenizer #906

wants to merge 4 commits into from

Conversation

wenbingl
Copy link
Member

@wenbingl wenbingl commented Mar 6, 2025

This is a pure C API, the internal implementation will be done in another PR.

@wenbingl wenbingl requested a review from a team as a code owner March 6, 2025 01:44
@wenbingl wenbingl marked this pull request as draft March 6, 2025 01:55
* @param add_generation_prompt Indicates whether to add a generation prompt to the output (defaults to true).
* @return extError_t Returns an error code indicating success or the type of failure.
*/
extError_t ORTX_API_CALL OrtxApplyChatTemplate(const OrtxTokenizer* tokenizer, const char* template_str,
Copy link
Member Author

Choose a reason for hiding this comment

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

a tokenizer object is needed because some bos_token and eos_token, and chat-template stored in json file only be only retrieved from the tokenizer object.

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.

1 participant