From e1b0b8f6ef07444d25c4977cc5494f280dc43447 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Mon, 30 Sep 2024 23:08:46 -0700 Subject: [PATCH] Update chat_templates.py --- unsloth/chat_templates.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/unsloth/chat_templates.py b/unsloth/chat_templates.py index 937cbd06ea..9b5f9ff28c 100644 --- a/unsloth/chat_templates.py +++ b/unsloth/chat_templates.py @@ -1606,6 +1606,9 @@ extra_eos_tokens = None, ollama_eos = get_ollama_eos_tokens(tokenizer, extra_eos_tokens) ollama_eos = '\n'.join(f'PARAMETER stop "{eos}"' for eos in ollama_eos) + # Add temperature and min_p to counteract gibberish + ollama_eos += "\nPARAMETER temperature 1.5\nPARAMETER min_p 0.1" + # Ollama modelfile part = '"""' modelfile = 'FROM {__FILE_LOCATION__}\n\n'\