Text Generation
Transformers
ONNX
Safetensors
English
llama
alignment-handbook
trl
sft
conversational
text-generation-inference
Run this model with HF Jobs
Run HuggingFaceTB/SmolLM-360M-Instruct on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/HuggingFaceTB/SmolLM-360M-Instruct. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/HuggingFaceTB/SmolLM-360M-Instruct on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/HuggingFaceTB/SmolLM-360M-Instruct. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Instructions to use HuggingFaceTB/SmolLM-360M-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HuggingFaceTB/SmolLM-360M-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="HuggingFaceTB/SmolLM-360M-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("HuggingFaceTB/SmolLM-360M-Instruct") model = AutoModelForCausalLM.from_pretrained("HuggingFaceTB/SmolLM-360M-Instruct", device_map="auto") 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use HuggingFaceTB/SmolLM-360M-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "HuggingFaceTB/SmolLM-360M-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HuggingFaceTB/SmolLM-360M-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/HuggingFaceTB/SmolLM-360M-Instruct
- SGLang
How to use HuggingFaceTB/SmolLM-360M-Instruct 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 "HuggingFaceTB/SmolLM-360M-Instruct" \ --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": "HuggingFaceTB/SmolLM-360M-Instruct", "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 "HuggingFaceTB/SmolLM-360M-Instruct" \ --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": "HuggingFaceTB/SmolLM-360M-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use HuggingFaceTB/SmolLM-360M-Instruct with Docker Model Runner:
docker model run hf.co/HuggingFaceTB/SmolLM-360M-Instruct
End of training
Browse filesFiles changed (5)
1234567895 unmodified lines15161718192021---base_model: HuggingFaceTB/cosmo2-350M-webinst-sc2tags:- trl- dpo- generated_from_trainermodel-index:- name: cosmo2-350M-webinst-sc2-dpo-argilla-ep1results: []5 unmodified lines[<img src="https://raw.githubusercontent.com/wandb/assets/main/wandb-github-badge-28.svg" alt="Visualize in Weights & Biases" width="200" height="32"/>](https://wandb.ai/loubnabnl/huggingface/runs/z5gb262b)# cosmo2-350M-webinst-sc2-dpo-argilla-ep1This model is a fine-tuned version of [HuggingFaceTB/cosmo2-350M-webinst-sc2](https://huggingface.co/HuggingFaceTB/cosmo2-350M-webinst-sc2) on an unknown dataset.## Model description1234567891011121314155 unmodified lines2122232425262728293031323334353637---base_model: HuggingFaceTB/cosmo2-350M-webinst-sc2tags:- alignment-handbook- trl- dpo- generated_from_trainer- trl- dpo- generated_from_trainerdatasets:- argilla/dpo-mix-7kmodel-index:- name: cosmo2-350M-webinst-sc2-dpo-argilla-ep1results: []5 unmodified lines[<img src="https://raw.githubusercontent.com/wandb/assets/main/wandb-github-badge-28.svg" alt="Visualize in Weights & Biases" width="200" height="32"/>](https://wandb.ai/loubnabnl/huggingface/runs/z5gb262b)# cosmo2-350M-webinst-sc2-dpo-argilla-ep1This model is a fine-tuned version of [HuggingFaceTB/cosmo2-350M-webinst-sc2](https://huggingface.co/HuggingFaceTB/cosmo2-350M-webinst-sc2) on the argilla/dpo-mix-7k dataset.It achieves the following results on the evaluation set:- Loss: 0.6834- Rewards/chosen: -0.0086- Rewards/rejected: -0.0304- Rewards/accuracies: 0.5938- Rewards/margins: 0.0218- Logps/rejected: -418.5675- Logps/chosen: -442.4709- Logits/rejected: -0.7106- Logits/chosen: -0.5211## Model description
12345{"epoch": 0.985781990521327,"total_flos": 0.0,"train_loss": 0.6860739244864538,"train_runtime": 316.322,123456789101112131415161718{"epoch": 0.985781990521327,"eval_logits/chosen": -0.5211005210876465,"eval_logits/rejected": -0.7105662226676941,"eval_logps/chosen": -442.4708557128906,"eval_logps/rejected": -418.5675354003906,"eval_loss": 0.6833909749984741,"eval_rewards/accuracies": 0.59375,"eval_rewards/chosen": -0.008601006120443344,"eval_rewards/margins": 0.021825773641467094,"eval_rewards/rejected": -0.03042677976191044,"eval_runtime": 8.5409,"eval_samples": 750,"eval_samples_per_second": 87.812,"eval_steps_per_second": 2.81,"total_flos": 0.0,"train_loss": 0.6860739244864538,"train_runtime": 316.322,
24 unmodified lines25262728293024 unmodified lines"tie_word_embeddings": true,"torch_dtype": "bfloat16","transformers_version": "4.42.3","use_cache": false,"vocab_size": 49152}24 unmodified lines25262728293024 unmodified lines"tie_word_embeddings": true,"torch_dtype": "bfloat16","transformers_version": "4.42.3","use_cache": true,"vocab_size": 49152}
12345678910111213141516{ "epoch": 0.985781990521327, "eval_logits/chosen": -0.5211005210876465, "eval_logits/rejected": -0.7105662226676941, "eval_logps/chosen": -442.4708557128906, "eval_logps/rejected": -418.5675354003906, "eval_loss": 0.6833909749984741, "eval_rewards/accuracies": 0.59375, "eval_rewards/chosen": -0.008601006120443344, "eval_rewards/margins": 0.021825773641467094, "eval_rewards/rejected": -0.03042677976191044, "eval_runtime": 8.5409, "eval_samples": 750, "eval_samples_per_second": 87.812, "eval_steps_per_second": 2.81}123version https://git-lfs.github.com/spec/v1oid sha256:958e3bee85da7cc72b429819cff501ffb58ca95731aaf61bdefa71b132d36753size 815README.md+17-1
all_results.json+13
config.json+1-1
eval_results.jsonAdded+16
runs/Jul15_21-49-55_ip-26-0-167-245/events.out.tfevents.1721080634.ip-26-0-167-245.4053728.1Added+3