Instructions to use justinthelaw/SmolLM2-360M-Instruct-Resume-Cover-Letter-SFT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use justinthelaw/SmolLM2-360M-Instruct-Resume-Cover-Letter-SFT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="justinthelaw/SmolLM2-360M-Instruct-Resume-Cover-Letter-SFT") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("justinthelaw/SmolLM2-360M-Instruct-Resume-Cover-Letter-SFT") model = AutoModelForCausalLM.from_pretrained("justinthelaw/SmolLM2-360M-Instruct-Resume-Cover-Letter-SFT") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Transformers.js
How to use justinthelaw/SmolLM2-360M-Instruct-Resume-Cover-Letter-SFT with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('text-generation', 'justinthelaw/SmolLM2-360M-Instruct-Resume-Cover-Letter-SFT'); - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use justinthelaw/SmolLM2-360M-Instruct-Resume-Cover-Letter-SFT with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "justinthelaw/SmolLM2-360M-Instruct-Resume-Cover-Letter-SFT" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "justinthelaw/SmolLM2-360M-Instruct-Resume-Cover-Letter-SFT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/justinthelaw/SmolLM2-360M-Instruct-Resume-Cover-Letter-SFT
- SGLang
How to use justinthelaw/SmolLM2-360M-Instruct-Resume-Cover-Letter-SFT with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "justinthelaw/SmolLM2-360M-Instruct-Resume-Cover-Letter-SFT" \ --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": "justinthelaw/SmolLM2-360M-Instruct-Resume-Cover-Letter-SFT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
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 "justinthelaw/SmolLM2-360M-Instruct-Resume-Cover-Letter-SFT" \ --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": "justinthelaw/SmolLM2-360M-Instruct-Resume-Cover-Letter-SFT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use justinthelaw/SmolLM2-360M-Instruct-Resume-Cover-Letter-SFT with Docker Model Runner:
docker model run hf.co/justinthelaw/SmolLM2-360M-Instruct-Resume-Cover-Letter-SFT
justinthelaw/SmolLM2-360M-Instruct-Resume-Cover-Letter-SFT
A fine-tuned version of HuggingFaceTB/SmolLM2-360M-Instruct trained with a two-stage pipeline (SFT + DPO) to answer questions about Justin's professional background, skills, and experience.
Model Description
This model is designed for browser-based inference using transformers.js. It powers a personal website chatbot that can answer questions about Justin's resume, work experience, education, and skills.
Training Pipeline
The model is trained using a SFT (Supervised Fine-Tuning) approach, where factual memorization is enforced via conversation-formatted QA pairs.
Training Details
- Base Model: HuggingFaceTB/SmolLM2-360M-Instruct
- Training Dataset: justinthelaw/Resume-Cover-Letter-SFT-Dataset
- LoRA Configuration:
- Rank (r): 128
- Alpha: 256
- Dropout: 0.05
- Target Modules: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
SFT Training Configuration
- Epochs: 16
- Batch Size: 16
- Learning Rate: 2e-05
Model Formats
This repository contains multiple model formats:
| Format | Location | Use Case |
|---|---|---|
| SafeTensors | / (root) |
Python/PyTorch inference |
| ONNX | /onnx/ |
Full precision and quantized weights for the ONNX Runtime |
Usage
Browser (transformers.js)
import { pipeline } from "@huggingface/transformers";
const generator = await pipeline(
"text-generation",
"justinthelaw/SmolLM2-360M-Instruct-Resume-Cover-Letter-SFT",
{ dtype: "q8" } // Uses model_quantized.onnx
);
const output = await generator("What is Justin's background?", {
max_new_tokens: 256,
temperature: 0.7,
});
Python (Transformers)
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("justinthelaw/SmolLM2-360M-Instruct-Resume-Cover-Letter-SFT")
tokenizer = AutoTokenizer.from_pretrained("justinthelaw/SmolLM2-360M-Instruct-Resume-Cover-Letter-SFT")
prompt = "What is Justin's background?"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Intended Use
This model is intended for:
- Personal website chatbots
- Resume Q&A applications
- Demonstrating fine-tuning techniques for personalized AI assistants
Limitations
- The model is specifically trained on Justin's resume and may not generalize to other topics
- Responses are based on training data and may not reflect real-time information
- Not suitable for general-purpose question answering
Author
Justin
- GitHub: justinthelaw
- HuggingFace: justinthelaw
License
This model is released under the Apache 2.0 license.
- Downloads last month
- 7
Model tree for justinthelaw/SmolLM2-360M-Instruct-Resume-Cover-Letter-SFT
Base model
HuggingFaceTB/SmolLM2-360M