Instructions to use ynanxiu/olmo190m-coffee-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use ynanxiu/olmo190m-coffee-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("ynanxiu/olmo3-190M-zh-full") model = PeftModel.from_pretrained(base_model, "ynanxiu/olmo190m-coffee-lora") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- Unsloth Studio new
How to use ynanxiu/olmo190m-coffee-lora with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for ynanxiu/olmo190m-coffee-lora to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for ynanxiu/olmo190m-coffee-lora to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for ynanxiu/olmo190m-coffee-lora to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="ynanxiu/olmo190m-coffee-lora", max_seq_length=2048, )
OLMo3-190M Coffee SFT (QLoRA)
使用 Unsloth 对 OLMo3-190M-zh-full 进行 QLoRA 微调的 LoRA adapter,数据集为 coffee-sft-dataset。
训练信息
- 基座模型: ynanxiu/olmo3-190M-zh-full (190M 参数)
- 数据集: coffee-sft-dataset (4,768 条咖啡领域对话)
- 微调方式: QLoRA (4-bit NF4 + LoRA r=16)
- 可训练参数: 3,391,488 / 190,403,328 (1.78%)
- 训练步数: 1,192 steps (1 epoch)
- 训练时间: ~13.7 分钟 (RTX 4060 8GB)
- 最终 Loss: ~2.84
- 学习率: 2e-4, cosine schedule, warmup 5%
技术栈
- Unsloth 2026.5.7 (2x faster finetuning)
- PEFT (QLoRA)
- TRL (SFTTrainer)
- bitsandbytes (4-bit quantization)
- PyTorch 2.6.0 + CUDA 12.4 + Triton 3.2.0
使用方法
from unsloth import FastLanguageModel
import torch
model, tokenizer = FastLanguageModel.from_pretrained(
"ynanxiu/olmo3-190M-zh-full",
load_in_4bit=True,
max_seq_length=1024,
)
from peft import PeftModel
model = PeftModel.from_pretrained(model, "ynanxiu/olmo190m-coffee-lora")
FastLanguageModel.for_inference(model)
messages = [{"role": "user", "content": "介绍一下咖啡的种类"}]
inputs = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
input_ids = tokenizer(inputs, return_tensors="pt").to(model.device)
outputs = model.generate(**input_ids, max_new_tokens=200, temperature=0.3)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
生成示例
Q: 请用专业口吻介绍咖啡的种类和特点。
咖啡主要分为阿拉比卡(Arabica)和罗布斯塔(Robusta)两大类:
- 阿拉比卡:占全球产量60-70%,生长于高海拔地区,风味复杂,酸度明显
- 罗布斯塔:抗病性强,低海拔种植,苦味重,咖啡因含量高
Q: 咖啡因对人体有什么影响?
咖啡因对人体有显著影响,具有镇痛作用,能够缓解疲劳,并降低患心脏病的风险。
- Downloads last month
- 27
Model tree for ynanxiu/olmo190m-coffee-lora
Base model
ynanxiu/olmo3-190M-zh-full