ereniko/SmolLLM2-135M-Code
215
1---2base_model: HuggingFaceTB/SmolLM2-135M-Instruct3library_name: peft4model_name: smol-code-finetuned5tags:6- base_model:adapter:HuggingFaceTB/SmolLM2-135M-Instruct7- lora8- sft9- transformers10- trl11licence: licence12pipeline_tag: text-generation13license: cc-by-nc-4.014---15 16# Model Card for SmolLLM2-135M-Code17 18This model is a fine-tuned version of [HuggingFaceTB/SmolLM2-135M-Instruct](https://huggingface.co/HuggingFaceTB/SmolLM2-135M-Instruct).19It has been trained using [TRL](https://github.com/huggingface/trl).20 21It's not anything magic, I just made this to test an Nvidia A30. It's hard to find on the cloud, but it's a really nice budget GPU for training with its low price and HBM.22 23## Quick start24 25```python26from peft import AutoPeftModelForCausalLM27from transformers import AutoTokenizer28 29model = AutoPeftModelForCausalLM.from_pretrained("ereniko/SmolLLM2-135M-Code")30tokenizer = AutoTokenizer.from_pretrained("ereniko/SmolLLM2-135M-Code")31 32def ask(instruction):33 prompt = f"### Instruction:\n{instruction}\n\n### Input:\n\n### Output:\n"34 inputs = tokenizer(prompt, return_tensors="pt").to(model.device)35 outputs = model.generate(**inputs, max_new_tokens=200, temperature=0.7, do_sample=True)36 print(tokenizer.decode(outputs[0], skip_special_tokens=True))37 38ask("Write a Python function to reverse a string")39```40 41## Training procedure42 43This model was trained with SFT.44 45### Framework versions46 47- PEFT 0.18.148- TRL: 0.29.049- Transformers: 5.2.050- Pytorch: 2.8.0+cu12851- Datasets: 4.6.052- Tokenizers: 0.22.253 54## Citations55 56 57 58Cite TRL as:59 60```bibtex61@software{vonwerra2020trl,62 title = {{TRL: Transformers Reinforcement Learning}},63 author = {von Werra, Leandro and Belkada, Younes and Tunstall, Lewis and Beeching, Edward and Thrush, Tristan and Lambert, Nathan and Huang, Shengyi and Rasul, Kashif and Gallouédec, Quentin},64 license = {Apache-2.0},65 url = {https://github.com/huggingface/trl},66 year = {2020}67}68```