Nanthasit/sakthai-combined-v5
Viewer • Updated • 710 • 52
How to use Nanthasit/sakthai-context-7b-tools with PEFT:
from peft import PeftModel
from transformers import AutoModelForCausalLM
base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-7B-Instruct")
model = PeftModel.from_pretrained(base_model, "Nanthasit/sakthai-context-7b-tools")How to use Nanthasit/sakthai-context-7b-tools with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="Nanthasit/sakthai-context-7b-tools")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("Nanthasit/sakthai-context-7b-tools", dtype="auto")How to use Nanthasit/sakthai-context-7b-tools with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "Nanthasit/sakthai-context-7b-tools"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "Nanthasit/sakthai-context-7b-tools",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/Nanthasit/sakthai-context-7b-tools
How to use Nanthasit/sakthai-context-7b-tools with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "Nanthasit/sakthai-context-7b-tools" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "Nanthasit/sakthai-context-7b-tools",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker run --gpus all \
--shm-size 32g \
-p 30000:30000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
--env "HF_TOKEN=<secret>" \
--ipc=host \
lmsysorg/sglang:latest \
python3 -m sglang.launch_server \
--model-path "Nanthasit/sakthai-context-7b-tools" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "Nanthasit/sakthai-context-7b-tools",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use Nanthasit/sakthai-context-7b-tools with Docker Model Runner:
docker model run hf.co/Nanthasit/sakthai-context-7b-tools
A LoRA fine-tune of Qwen/Qwen2.5-7B-Instruct for structured tool-calling and instruction following, trained on the SakThai tool-calling curriculum.
transformers with device_map="auto")from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_model = AutoModelForCausalLM.from_pretrained(
"Qwen/Qwen2.5-7B-Instruct",
torch_dtype="bfloat16",
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-7B-Instruct")
model = PeftModel.from_pretrained(base_model, "Nanthasit/sakthai-context-7b-tools")
The model uses Qwen2.5's standard chat template with system/user/assistant roles and supports function-calling via the tools parameter in the tokenizer.
For production inference, use the merged model instead: 👉 Nanthasit/sakthai-context-7b-merged
r=16, lora_alpha=32, target_modules=["q_proj", "k_proj", "v_proj", "o_proj", "gate_proj", "up_proj", "down_proj"]