Views
No views yet
Qwen/Qwen2.5-0.5B-Instruct.Qwen/Qwen2.5-0.5B-Instruct2.3422.1061import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3from peft import PeftModel
4
5base_model_id = "Qwen/Qwen2.5-0.5B-Instruct"
6adapter_id = "mgbam/gaialab-naija-adapter-v0.1"
7
8tokenizer = AutoTokenizer.from_pretrained(base_model_id)
9
10base_model = AutoModelForCausalLM.from_pretrained(
11 base_model_id,
12 dtype=torch.float16,
13 device_map="auto"
14)
15
16model = PeftModel.from_pretrained(
17 base_model,
18 adapter_id
19)
20
21model.eval()
22
23Load the tokenizer from the base model because it contains the correct
24Qwen chat template.
25
26Model repository
27
28Hugging Face:
29
30mgbam/gaialab-naija-adapter-v0.1
31
32Source code
33
34GitHub:
35
36oluwafemidiakhoa/gaialab-naija-assistant
37
38Disclaimer
39
40This is an experimental research release. Generated responses should be
41reviewed before use in business, legal, financial, tax, medical, or
42regulatory contexts.