A
QLoRA fine-tune of
Mistral-7B-Instruct-v0.3 for hotel booking dialogs and hospitality FAQ.
Trained on Google Colab with an A100 40 GB GPU.
Try the model live:
Mistral Hospitality Assistant — runs on ZeroGPU (free A10G).
1from peft import PeftModel
2from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
3import torch
4
5bnb = BitsAndBytesConfig(
6 load_in_4bit=True,
7 bnb_4bit_compute_dtype=torch.bfloat16,
8 bnb_4bit_use_double_quant=True,
9 bnb_4bit_quant_type="nf4",
10)
11base = AutoModelForCausalLM.from_pretrained(
12 "mistralai/Mistral-7B-Instruct-v0.3",
13 quantization_config=bnb,
14 device_map="auto",
15)
16model = PeftModel.from_pretrained(base, "Hadix10/mistral-hospitality-qlora")
17tokenizer = AutoTokenizer.from_pretrained("Hadix10/mistral-hospitality-qlora")
18
19prompt = "[INST] What are the check-in and check-out times? [/INST]"
20inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
21out = model.generate(**inputs, max_new_tokens=256, temperature=0.7, do_sample=True, top_p=0.9)
22print(tokenizer.decode(out[0], skip_special_tokens=True))
A standalone merged model with the adapter baked into the base weights is available at
Hadix10/mistral-hospitality-merged. No PEFT dependency needed at inference time — load it like any standard Hugging Face model:
1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model = AutoModelForCausalLM.from_pretrained("Hadix10/mistral-hospitality-merged", device_map="auto")
4tokenizer = AutoTokenizer.from_pretrained("Hadix10/mistral-hospitality-merged")
The full training pipeline, evaluation scripts, API server, and test suite are available on GitHub:
Features: QLoRA training, adapter merging, ROUGE + perplexity evaluation, LLM-as-judge scoring (Gemini), W&B logging, FastAPI server with SSE streaming, Gradio demo, and a full test suite.