mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-15 23:31:29 +00:00
fix(factory.py): correctly apply bos token for llama3 instruct prompt template
This commit is contained in:
parent
5bd50a6cc0
commit
ccb864bbea
1 changed files with 2 additions and 8 deletions
|
|
@ -1350,11 +1350,8 @@ def prompt_factory(
|
|||
return llama_2_chat_pt(messages=messages)
|
||||
elif "llama3" in model and "instruct" in model:
|
||||
return hf_chat_template(
|
||||
model=model,
|
||||
model="meta-llama/Meta-Llama-3-8B-Instruct",
|
||||
messages=messages,
|
||||
chat_template=known_tokenizer_config[ # type: ignore
|
||||
"meta-llama/Meta-Llama-3-8B-Instruct"
|
||||
]["tokenizer"]["chat_template"],
|
||||
)
|
||||
elif custom_llm_provider == "perplexity":
|
||||
for message in messages:
|
||||
|
|
@ -1369,11 +1366,8 @@ def prompt_factory(
|
|||
"meta-llama/llama-3" in model or "meta-llama-3" in model
|
||||
) and "instruct" in model:
|
||||
return hf_chat_template(
|
||||
model=model,
|
||||
model="meta-llama/Meta-Llama-3-8B-Instruct",
|
||||
messages=messages,
|
||||
chat_template=known_tokenizer_config[ # type: ignore
|
||||
"meta-llama/Meta-Llama-3-8B-Instruct"
|
||||
]["tokenizer"]["chat_template"],
|
||||
)
|
||||
elif (
|
||||
"tiiuae/falcon" in model
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue