HuggingFaceH4/ultrachat_200k
Viewer • Updated • 515k • 72.9k • 710
How to use M3LBY/SmolLM2-1.7B-UltraChat_200k with PEFT:
from peft import PeftModel
from transformers import AutoModelForCausalLM
base_model = AutoModelForCausalLM.from_pretrained("HuggingFaceTB/SmolLM2-1.7B")
model = PeftModel.from_pretrained(base_model, "M3LBY/SmolLM2-1.7B-UltraChat_200k")Quantized Low Rank Adaptation (QLoRA) finetuned from HuggingFaceTB/SmolLM2-1.7B to UltraChat 200k dataset.
Serves as an exercise in LLM post-training.
Training and inference scripts are available here.
Use the code below to get started with the model.
from peft import LoraConfig, get_peft_model, TaskType
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("M3LBY/SmolLM2-1.7B-UltraChat_200k")
tokenizer = AutoTokenizer.from_pretrained("M3LBY/SmolLM2-1.7B-UltraChat_200k")
messages = [{"role": "user", "content": "How far away is the sun?"}]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
The adapter model was trained using Supervised Fine-Tuning (SFT) with the following configuration:
Trained to a loss of 1.6965 after 6,496 steps.
Elapsed time: 2 hours 37 minutes.
Consumed ~22 Colab Compute Units for an estimated cost of $2.21 cents.
BibTeX:
[More Information Needed]
APA:
[More Information Needed]
Base model
HuggingFaceTB/SmolLM2-1.7B