Instructions to use agentlans/SmolLM2-135M-Instruct-Plus with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use agentlans/SmolLM2-135M-Instruct-Plus with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="agentlans/SmolLM2-135M-Instruct-Plus") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("agentlans/SmolLM2-135M-Instruct-Plus") model = AutoModelForCausalLM.from_pretrained("agentlans/SmolLM2-135M-Instruct-Plus") 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use agentlans/SmolLM2-135M-Instruct-Plus with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "agentlans/SmolLM2-135M-Instruct-Plus" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "agentlans/SmolLM2-135M-Instruct-Plus", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/agentlans/SmolLM2-135M-Instruct-Plus
- SGLang
How to use agentlans/SmolLM2-135M-Instruct-Plus 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 "agentlans/SmolLM2-135M-Instruct-Plus" \ --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": "agentlans/SmolLM2-135M-Instruct-Plus", "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 "agentlans/SmolLM2-135M-Instruct-Plus" \ --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": "agentlans/SmolLM2-135M-Instruct-Plus", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use agentlans/SmolLM2-135M-Instruct-Plus with Docker Model Runner:
docker model run hf.co/agentlans/SmolLM2-135M-Instruct-Plus
SmolLM2-135M-Instruct-Plus
This model is a finetuned version of HuggingFaceTB/SmolLM2-135M-Instruct, aiming to maximize knowledge in a small 135M parameter model.
⚠️ Consider this model a creative text generator. Without additional finetuning, it gives wildly inaccurate answers. Don't trust the output of this model without additional verification.
Model Details
- Base Model: HuggingFaceTB/SmolLM2-135M-Instruct
- Finetuning Datasets:
- agentlans/crash-course (120K subset)
- Intel/orca_dpo_pairs
- Training Procedure:
- Supervised Fine-Tuning (SFT) on
crash-coursefor 1 epoch. - Direct Preference Optimization (DPO) on
orca_dpo_pairs.
- Supervised Fine-Tuning (SFT) on
Intended Uses
For research, experimentation, and educational purposes where a small instruction-following model is desired.
Limitations
- Hallucinations: Prone to generating incorrect information due to its small size.
- Repetitive Output: May produce repetitive text.
Training Details
Both SFT and DPO share common settings: liger_kernel booster, LoRA fine-tuning, custom model, BF16 compute type, batch size of 2, and a cosine scheduler with a learning rate of 5e-5. RSLoRA is enabled with a rank of 16 and alpha of 32.
The main differences are in the dataset and training specifics. SFT uses CrashCourse_120K with packing enabled and LoRA dropout of 0, while DPO uses orca_pairs with packing disabled and a LoRA dropout of 0.95.
Evaluation
Provides coherent and creative answers but may often be incorrect. Thorough evaluation is recommended before deployment.
- Downloads last month
- 5
Model tree for agentlans/SmolLM2-135M-Instruct-Plus
Base model
HuggingFaceTB/SmolLM2-135M
docker model run hf.co/agentlans/SmolLM2-135M-Instruct-Plus