LoRA adapter for Qwen/Qwen2.5-1.5B-Instruct, trained on questions and answers about public transport to the UAM Cantoblanco campus (Cercanías C-4 and interurban bus lines).
This is a proof of concept for a Hugging Face workshop on LoRA and quantization. It is not an official source.
question / answer in englishNo automatic evaluation has been run. The model was checked by hand with a set of questions about the campus routes and schedules.
from peft import AutoPeftModelForCausalLM
from transformers import AutoTokenizer
REPO = "Bellido/qwen2.5-1.5b-cantoblanco-transporte-en-lora"
tokenizer = AutoTokenizer.from_pretrained(REPO)
model = AutoPeftModelForCausalLM.from_pretrained(REPO, device_map="auto")
messages = [
{"role": "system", "content": "You are an assistant that helps with train and bus transport information to Cantoblanco, Madrid, Spain, answer precisely and concisely."},
{"role": "user", "content": "How do I get from Sol to UAM Cantoblanco?"},
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=128, do_sample=False)
print(tokenizer.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
Use the same system prompt as in training to get the closest behavior.
Can I go from Parla to Cantoblanco? -> Yes, the Cercanías C-4 stops at Parla and reaches Universidad Cantoblanco in 57 minutes.
Is colmenar viejo close to cantoblanco? -> From Colmenar Viejo the Cercanías takes approximately 17 minutes to Universidad Cantoblanco.
What bus or buses should i take from Canillejas to Cantoblanco? -> Bus 827 stops at Canillejas and reaches Universidad Cantoblanco in 4 minutes.
What is the best way to go from cantoblanco to Alcobendas? -> The best option is the Cercanías C-4b. It takes about 9 minutes from Universidad Cantoblanco.
What bus should I take from Plaza castilla to get to cantoblanco? -> Bus 714 leaves from Plaza Castilla Interchange and reaches Universidad Cantoblanco in about 6 minutes.
How much time does it take to go from tres cantos to cantoblanco? -> From Tres Cantos it takes approximately 10 minutes to reach Universidad Cantoblanco.
Qwen/Qwen2.5-1.5B-Instruct