mlabonne/FineTome-100k
Viewer • Updated • 100k • 20k • 268
How to use kshitijthakkar/lfm-finetuned with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="kshitijthakkar/lfm-finetuned")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("kshitijthakkar/lfm-finetuned", dtype="auto")How to use kshitijthakkar/lfm-finetuned with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "kshitijthakkar/lfm-finetuned"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "kshitijthakkar/lfm-finetuned",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/kshitijthakkar/lfm-finetuned
How to use kshitijthakkar/lfm-finetuned with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "kshitijthakkar/lfm-finetuned" \
--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": "kshitijthakkar/lfm-finetuned",
"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 "kshitijthakkar/lfm-finetuned" \
--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": "kshitijthakkar/lfm-finetuned",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use kshitijthakkar/lfm-finetuned 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 kshitijthakkar/lfm-finetuned 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 kshitijthakkar/lfm-finetuned to start chatting
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for kshitijthakkar/lfm-finetuned to start chatting
pip install unsloth
from unsloth import FastModel
model, tokenizer = FastModel.from_pretrained(
model_name="kshitijthakkar/lfm-finetuned",
max_seq_length=2048,
)How to use kshitijthakkar/lfm-finetuned with Docker Model Runner:
docker model run hf.co/kshitijthakkar/lfm-finetuned
A LoRA fine-tune of LiquidAI/LFM2.5-1.2B-Instruct on mlabonne/FineTome-100k for improved instruction following and conversational ability.
Trained using Unsloth SFT on Hugging Face Jobs.
| Parameter | Value |
|---|---|
| Base model | LiquidAI/LFM2.5-1.2B-Instruct (1.17B params) |
| Method | SFT with LoRA via Unsloth |
| Dataset | mlabonne/FineTome-100k (80k train / 20k eval) |
| Hardware | NVIDIA A10G on HF Jobs |
| Epochs | 1 |
| Batch size | 2 x 4 gradient accumulation = 8 effective |
| Learning rate | 2e-4 |
| Max sequence length | 2048 |
| Total steps | 9,991 |
| Parameter | Value |
|---|---|
| Rank (r) | 16 |
| Trainable parameters | 11,108,352 / 1,181,448,960 (0.94%) |
| Step | Loss | Grad Norm | Learning Rate | Epoch |
|---|---|---|---|---|
| 1,000 | 0.6984 | 0.349 | 1.80e-4 | 0.10 |
| 2,000 | 0.6898 | 0.298 | 1.60e-4 | 0.20 |
| 3,000 | 0.6696 | 0.266 | 1.40e-4 | 0.30 |
| 4,000 | 0.6694 | 0.523 | 1.20e-4 | 0.40 |
| 5,000 | 0.6697 | 0.356 | 1.00e-4 | 0.50 |
| 6,000 | 0.6766 | 0.367 | 8.00e-5 | 0.60 |
| 7,000 | 0.6574 | 0.426 | 6.00e-5 | 0.70 |
| 8,000 | 0.6562 | 0.387 | 4.00e-5 | 0.80 |
| 9,000 | 0.6673 | 0.516 | 2.00e-5 | 0.90 |
Final training loss: 0.6562 (at step 8,000). Loss decreased from 0.6984 to 0.6562 over the course of training (~6% reduction).
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base_model = AutoModelForCausalLM.from_pretrained("LiquidAI/LFM2.5-1.2B-Instruct")
model = PeftModel.from_pretrained(base_model, "kshitijthakkar/lfm-finetuned")
tokenizer = AutoTokenizer.from_pretrained("kshitijthakkar/lfm-finetuned")
messages = [
{"role": "user", "content": "Explain the theory of relativity in simple terms."}
]
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True)
outputs = model.generate(inputs, max_new_tokens=256, temperature=0.7)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
model_name="kshitijthakkar/lfm-finetuned",
max_seq_length=2048,
)
FastLanguageModel.for_inference(model)
Trained on Hugging Face Jobs using the Unsloth SFT training script with an NVIDIA A10G GPU.
Base model
LiquidAI/LFM2.5-1.2B-Base