Text Generation
Transformers
Safetensors
PyTorch
English
llama
fine-tuned
smollm
causal-lm
conversational
text-generation-inference
Instructions to use terrytaylorbonn/431_smollmv3_CPLT29 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use terrytaylorbonn/431_smollmv3_CPLT29 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="terrytaylorbonn/431_smollmv3_CPLT29") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("terrytaylorbonn/431_smollmv3_CPLT29") model = AutoModelForCausalLM.from_pretrained("terrytaylorbonn/431_smollmv3_CPLT29") 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 Settings
- vLLM
How to use terrytaylorbonn/431_smollmv3_CPLT29 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "terrytaylorbonn/431_smollmv3_CPLT29" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "terrytaylorbonn/431_smollmv3_CPLT29", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/terrytaylorbonn/431_smollmv3_CPLT29
- SGLang
How to use terrytaylorbonn/431_smollmv3_CPLT29 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 "terrytaylorbonn/431_smollmv3_CPLT29" \ --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": "terrytaylorbonn/431_smollmv3_CPLT29", "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 "terrytaylorbonn/431_smollmv3_CPLT29" \ --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": "terrytaylorbonn/431_smollmv3_CPLT29", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use terrytaylorbonn/431_smollmv3_CPLT29 with Docker Model Runner:
docker model run hf.co/terrytaylorbonn/431_smollmv3_CPLT29
Fine-tuned SmolLM Model
This model is a fine-tuned version of HuggingFaceTB/SmolLM2-1.7B-Instruct.
Training Details
- Base Model: HuggingFaceTB/SmolLM2-1.7B-Instruct
- Fine-tuning Method: LoRA (Low-Rank Adaptation)
- Hardware: NVIDIA RTX 3050 (4GB VRAM)
- Framework: PyTorch + Transformers + PEFT
Usage
from transformers import AutoTokenizer, AutoModelForCausalLM
# Load model
tokenizer = AutoTokenizer.from_pretrained("terrytaylorbonn/431_smollmv3_CPLT29")
model = AutoModelForCausalLM.from_pretrained("terrytaylorbonn/431_smollmv3_CPLT29")
# Generate text
messages = [{"role": "user", "content": "Your prompt here"}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=200)
response = tokenizer.decode(outputs[0][len(inputs.input_ids[0]):], skip_special_tokens=True)
print(response)
Training Configuration
- Batch Size: 1 (with gradient accumulation)
- Learning Rate: 2e-4
- LoRA Rank: 16
- LoRA Alpha: 32
- Training Steps: Variable based on dataset
Limitations
This model inherits the limitations of the base model and may have additional biases from the fine-tuning data.
- Downloads last month
- 1
Model tree for terrytaylorbonn/431_smollmv3_CPLT29
Base model
HuggingFaceTB/SmolLM2-1.7B Quantized
HuggingFaceTB/SmolLM2-1.7B-Instruct