The best-performing model in the SakThai Context family. A full-parameter merged checkpoint of Qwen2.5-7B-Instruct with LoRA adapters fine-tuned for structured tool-calling and instruction following.
fromtransformersimportAutoModelForCausalLM,AutoTokenizermodel=AutoModelForCausalLM.from_pretrained("Nanthasit/sakthai-context-7b-merged",torch_dtype="bfloat16",device_map="auto")tokenizer=AutoTokenizer.from_pretrained("Nanthasit/sakthai-context-7b-merged")messages=[{"role":"user","content":"What's the weather like in Bangkok?"}]text=tokenizer.apply_chat_template(messages,tokenize=False,add_generation_prompt=True)inputs=tokenizer(text,return_tensors="pt").to(model.device)outputs=model.generate(**inputs,max_new_tokens=256,temperature=0.7)print(tokenizer.decode(outputs[0],skip_special_tokens=True))
Tool Calling
The model supports structured tool-calling via Qwen2.5's tokenizer tool schema:
messages=[{"role":"system","content":"You are a helpful assistant with access to tools."},{"role":"user","content":"What's the weather in Bangkok?"}]tools=[{"type":"function","function":{"name":"get_weather","description":"Get current weather","parameters":{"type":"object","properties":{"location":{"type":"string"}},"required":["location"]}}}]text=tokenizer.apply_chat_template(messages,tools=tools,tokenize=False,add_generation_prompt=True)
Evaluation Results
Tested on a Tesla T4 (5.56 GB VRAM) via Hugging Face Jobs: