NousResearch/hermes-function-calling-v1
Viewer • Updated • 11.6k • 21.7k • 502
How to use cortex-ai-nova/Tendo-4-Adapter with PEFT:
from peft import PeftModel
from transformers import AutoModelForCausalLM
base_model = AutoModelForCausalLM.from_pretrained("unsloth/Qwen2.5-14B-Instruct-bnb-4bit")
model = PeftModel.from_pretrained(base_model, "cortex-ai-nova/Tendo-4-Adapter")LoRA-адаптер к Qwen2.5-14B-Instruct для вызова функций (формат Hermes <tool_call>) и ответов в JSON по схеме.
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained("cortex-ai-nova/NOVA-Tendo-4-Lite", max_seq_length=2048, load_in_4bit=True)
FastLanguageModel.for_inference(model)
Передавайте инструменты через tokenizer.apply_chat_template(messages, tools=tools, ...).
Для JSON mode используйте системный промпт:
You are a helpful assistant that answers in JSON. Here's the json schema you must adhere to:\n<schema>\n{schema}\n</schema>
Обучение короткое, на английских данных. Проверяйте JSON и аргументы функций перед исполнением.