Views
No views yet
| Parameter | Value |
|---|---|
| Base model | Mistral-7B-Instruct-v0.2 |
| Technique | QLoRA — 4-bit NF4 quantization |
| LoRA rank (r) | 16 |
| LoRA alpha | 32 |
| Training examples | 119 |
| Validation examples | 21 |
| Epochs | 3 |
| Final loss | 0.4590 |
| Optimizer | paged_adamw_8bit |
| Precision | bf16 |
| Hardware | Tesla T4 GPU (15.6GB) |
1from transformers import AutoTokenizer, AutoModelForCausalLM
2from peft import PeftModel
3import torch
4
5base_model = "mistralai/Mistral-7B-Instruct-v0.2"
6peft_model = "RRK1987/automotive-diagnostics-llm"
7
8tokenizer = AutoTokenizer.from_pretrained(peft_model)
9model = AutoModelForCausalLM.from_pretrained(
10 base_model,
11 load_in_4bit=True,
12 device_map="auto",
13)
14model = PeftModel.from_pretrained(model, peft_model)
15
16prompt = "<s>[INST] You are an expert automotive diagnostics assistant. My 2019 Toyota Camry is showing fault code P0300. I am experiencing rough idle and engine shaking. Can you diagnose this? [/INST]"
17inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
18outputs = model.generate(**inputs, max_new_tokens=300)
19print(tokenizer.decode(outputs[0], skip_special_tokens=True))