gen_utils ========= .. py:module:: gen_utils Functions --------- .. autoapisummary:: gen_utils.transform_chat_template_with_prompt Module Contents --------------- .. py:function:: transform_chat_template_with_prompt(prefix: str, prompt: str, tokenizer: transformers.AutoTokenizer, use_chat_template: bool = False, template_type: str = None, system_prompt: str = '', forced_prefix: str = '') -> str Transform a prefix with a prompt into a chat template Parameters: prefix : str The prefix to use prompt : str The prompt to use tokenizer : AutoTokenizer The tokenizer to use use_chat_template : bool, optional Whether to use a chat template, by default False template_type : str, optional The type of template to use, by default None system_prompt : str, optional The system prompt to use, by default "" Returns: str The transformed prefix