Skip to content

Commit

Permalink
Model: Add support for chat_template.json
Browse files Browse the repository at this point in the history
HuggingFace separated the chat template in the newest transformers
versions.

Signed-off-by: kingbri <[email protected]>
  • Loading branch information
bdashore3 committed Nov 11, 2024
1 parent b8700fb commit 9530f8c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions backends/exllamav2/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,10 @@ async def find_prompt_template(self, prompt_template_name, model_directory):
logger.info("Attempting to load a prompt template if present.")

find_template_functions = [
lambda: PromptTemplate.from_model_json(
pathlib.Path(self.config.model_dir) / "chat_template.json",
key="chat_template",
),
lambda: PromptTemplate.from_model_json(
pathlib.Path(self.config.model_dir) / "tokenizer_config.json",
key="chat_template",
Expand Down

0 comments on commit 9530f8c

Please sign in to comment.