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'\