Downloads · 30 days
13
30% of all-time downloads
emmaoba/davanai-2
davanai-2 is a text generation model from emmaoba. Use it when you need the model to write or continue text. It is set up for peft.
A LoRA adapter fine-tuned on microsoft/Phi-4-mini-instruct (3.8B), developed by Vega Aiden Lab.
Downloads · 30 days
13
30% of all-time downloads
All-time downloads
43
Public
Repo size
108 MB
Likes
1
Public
Click a slice to open those files.
.safetensors92.3 MB · 86%
From the Hugging Face model README
A LoRA adapter fine-tuned on microsoft/Phi-4-mini-instruct (3.8B), developed by Vega Aiden Lab.
This is a LoRA adapter, not a full model. You download the base model microsoft/Phi-4-mini-instruct and apply this adapter on top. Phi-4-mini is small (3.8B), so it runs on a normal GPU (8 GB+) or even on CPU if you're patient.
pip install torch transformers peft accelerate safetensors
pip install -U "huggingface_hub[cli]"
hf auth login
Paste a token from https://huggingface.co/settings/tokens when asked.
run.pyfrom transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base = "microsoft/Phi-4-mini-instruct"
adapter = "emmaoba/davanai-2"
tokenizer = AutoTokenizer.from_pretrained(base)
model = AutoModelForCausalLM.from_pretrained(
base,
device_map="auto",
torch_dtype="auto",
)
# Apply the davanai 2 adapter
model = PeftModel.from_pretrained(model, adapter)
model.eval()
messages = [{"role": "user", "content": "Hello! Who are you?"}]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256, do_sample=True, temperature=0.7)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
python run.py
The first run downloads the base model (once, then cached), then prints davanai 2's reply.