Views
No views yet
This is a LoRA adapter, not a full model. To run it you download the base model Qwen/Qwen2.5-32B and apply this adapter on top. The base model is large, so make sure your machine can handle it (see hardware note below).
pip install torch transformers peft accelerate safetensors1pip install -U "huggingface_hub[cli]"
2hf auth loginrun.py and paste this in1from transformers import AutoModelForCausalLM, AutoTokenizer
2from peft import PeftModel
3
4base = "Qwen/Qwen2.5-32B"
5adapter = "emmaoba/davanai"
6
7# Load tokenizer and base model
8tokenizer = AutoTokenizer.from_pretrained(base)
9model = AutoModelForCausalLM.from_pretrained(
10 base,
11 device_map="auto", # uses your GPU automatically
12 torch_dtype="auto",
13)
14
15# Apply the davanai 1 adapter
16model = PeftModel.from_pretrained(model, adapter)
17model.eval()
18
19# Chat with it
20messages = [{"role": "user", "content": "Hello! Who are you?"}]
21prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
22
23inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
24outputs = model.generate(**inputs, max_new_tokens=256, do_sample=True, temperature=0.7)
25print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))python run.pybitsandbytes (pip install bitsandbytes) and change the model loading line to:1model = AutoModelForCausalLM.from_pretrained(
2 base,
3 device_map="auto",
4 load_in_4bit=True,
5)