From 2001f583601cbc119f0487b429baf3e481ddc275 Mon Sep 17 00:00:00 2001 From: aimfordeb <133010426+aimfordeb@users.noreply.github.com> Date: Fri, 23 Jan 2026 15:44:37 +0200 Subject: [PATCH] Fix for broken chat template --- funpack.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/funpack.py b/funpack.py index 6ee7cb00..26d21fbf 100644 --- a/funpack.py +++ b/funpack.py @@ -489,10 +489,10 @@ class FunPackPromptEnhancer: "model_path_type": (["Local Safetensors", "HuggingFace Pretrained"],), "model_path": ("STRING", {"multiline": False, "default": "mlabonne/NeuralLlama-3-8B-Instruct-abliterated"}), "llm_safetensors_file": (folder_paths.get_filename_list('clip'),), - "top_p": ("FLOAT", {"min": 0.0, "max": 1.0, "step": 0.05, "default": 0.75}), + "top_p": ("FLOAT", {"min": 0.0, "max": 2.0, "step": 0.05, "default": 0.75}), "top_k": ("INT", {"min": 0, "max": 1000, "step": 1, "default": 40}), - "temperature": ("FLOAT", {"min": 0.0, "max": 1.0, "step": 0.01, "default": 0.6}), - "max_new_tokens": ("INT", {"min": 1, "max": 2048, "step": 64, "default": 1024}), + "temperature": ("FLOAT", {"min": 0.0, "max": 2.0, "step": 0.01, "default": 0.6}), + "max_new_tokens": ("INT", {"min": 1, "max": 4096, "step": 64, "default": 512}), } } @@ -536,6 +536,7 @@ class FunPackPromptEnhancer: llm_tokens = llm_tokenizer.apply_chat_template( messages, + chat_template="llama-3", add_generation_prompt=True, return_tensors="pt", tokenize=True @@ -1175,5 +1176,6 @@ NODE_DISPLAY_NAME_MAPPINGS = { +