Views
No views yet

| Release | Description |
|---|---|
| v0.1 | Initial release of SmolLM-Instruct. We finetune on the permissive subset of the WebInstructSub dataset, combined with StarCoder2-Self-OSS-Instruct. Then, we perform DPO (Direct Preference Optimization) for one epoch on HelpSteer for the 135M and 1.7B models, and argilla/dpo-mix-7k for the 360M model. |
| v0.2 | We changed the finetuning mix to datasets more suitable for smol models. We train on a new dataset of 2k simple everyday conversations we generated by llama3.1-70B everyday-conversations-llama3.1-2k, Magpie-Pro-300K-Filtered, StarCoder2-Self-OSS-Instruct, and a small subset of OpenHermes-2.5 |
revision="v0.1" in the transformers code:model = AutoModelForCausalLM.from_pretrained("HuggingFaceTB/SmolLM-135M-Instruct", revision="v0.1")q016 for MLC and ONNX/Transformers.js checkpoints for the WebGPU demos. We also suggest using temperature 0.2 and top-p 0.9.pip install transformers1# pip install transformers
2from transformers import AutoModelForCausalLM, AutoTokenizer
3checkpoint = "HuggingFaceTB/SmolLM-135M-Instruct"
4
5device = "cuda" # for GPU usage or "cpu" for CPU usage
6tokenizer = AutoTokenizer.from_pretrained(checkpoint)
7# for multiple GPUs install accelerate and do `model = AutoModelForCausalLM.from_pretrained(checkpoint, device_map="auto")`
8model = AutoModelForCausalLM.from_pretrained(checkpoint).to(device)
9
10messages = [{"role": "user", "content": "What is the capital of France."}]
11input_text=tokenizer.apply_chat_template(messages, tokenize=False)
12print(input_text)
13inputs = tokenizer.encode(input_text, return_tensors="pt").to(device)
14outputs = model.generate(inputs, max_new_tokens=50, temperature=0.2, top_p=0.9, do_sample=True)
15print(tokenizer.decode(outputs[0]))1pip install trl
2trl chat --model_name_or_path HuggingFaceTB/SmolLM-135M-Instruct --device cpu1@misc{allal2024SmolLM,
2 title={SmolLM - blazingly fast and remarkably powerful},
3 author={Loubna Ben Allal and Anton Lozhkov and Elie Bakouch and Leandro von Werra and Thomas Wolf},
4 year={2024},
5}