Model: Add TokenizerConfig stub and add_eos_token fallback

This stub fetches the add_eos_token field from the HF tokenizer config.
Ideally, this should be in the backend rather than tabby.

Signed-off-by: kingbri <8082010+kingbri1@users.noreply.github.com>
This commit is contained in:
kingbri
2025-05-02 00:08:01 -04:00
parent aa657fa6e9
commit 47cb2a0de9
3 changed files with 46 additions and 3 deletions

View File

@@ -239,6 +239,7 @@ async def find_prompt_template(template_name, model_dir: pathlib.Path):
]
# Add lookup from prompt template name if provided
# TODO: Possibly link to the TokenizerConfig class
if template_name:
find_template_functions[:0] = [
lambda: PromptTemplate.from_file(pathlib.Path("templates") / template_name),