retrain-pipelines/func_calls_ds
Viewer • Updated • 72.9k • 100 • 5
How to use retrain-pipelines/function_caller_lora with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="retrain-pipelines/function_caller_lora")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("retrain-pipelines/function_caller_lora", dtype="auto")How to use retrain-pipelines/function_caller_lora with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "retrain-pipelines/function_caller_lora"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "retrain-pipelines/function_caller_lora",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/retrain-pipelines/function_caller_lora
How to use retrain-pipelines/function_caller_lora with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "retrain-pipelines/function_caller_lora" \
--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": "retrain-pipelines/function_caller_lora",
"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 "retrain-pipelines/function_caller_lora" \
--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": "retrain-pipelines/function_caller_lora",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use retrain-pipelines/function_caller_lora with Unsloth Studio:
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for retrain-pipelines/function_caller_lora to start chatting
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for retrain-pipelines/function_caller_lora to start chatting
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for retrain-pipelines/function_caller_lora to start chatting
pip install unsloth
from unsloth import FastModel
model, tokenizer = FastModel.from_pretrained(
model_name="retrain-pipelines/function_caller_lora",
max_seq_length=2048,
)How to use retrain-pipelines/function_caller_lora with Docker Model Runner:
docker model run hf.co/retrain-pipelines/function_caller_lora
version 0.32 - 2026-02-21 01:24:19 UTC
(retraining
source-code |
pipeline-card)
Training dataset :
retrain-pipelines/func_calls_ds v0.31
(70f9a28 -
2026-02-20 18:34:18 UTC) Base model :
unsloth/Qwen2.5-1.5B
(1582479 -
2025-04-28 04:13:37 UTC) 2407.10671The herein LoRa adapter can for instance be used as follows :
from transformers import AutoModelForCausalLM, AutoTokenizer
from torch import device, cuda
repo_id = "retrain-pipelines/function_caller_lora"
revision = "<model_revision_commit_hash>"
model = AutoModelForCausalLM.from_pretrained(
repo_id, revision=revision, torch_dtype="auto", device_map="auto")
tokenizer = AutoTokenizer.from_pretrained(
repo_id, revision=revision, torch_dtype="auto", device_map="auto")
device = device("cuda" if cuda.is_available() else "cpu")
def generate_tool_calls_list(query, max_new_tokens=400) -> str:
formatted_query = tokenizer.chat_template.format(query, "")
inputs = tokenizer(formatted_query, return_tensors="pt").input_ids.to(device)
outputs = model.generate(inputs, max_new_tokens=max_new_tokens, do_sample=False)
generated_text = tokenizer.batch_decode(outputs, skip_special_tokens=True)[0]
return generated_text[len(formatted_query):].strip()
generate_tool_calls_list("Is 49 a perfect square ?")
retrain-pipelines
0.1.2 -
Run by Aurelien-Morgan-Bot -
UnslothFuncCallFlow - exec_id : 135