Instructions to use emmaoba/davanai-2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use emmaoba/davanai-2 with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("microsoft/Phi-4-mini-instruct") model = PeftModel.from_pretrained(base_model, "emmaoba/davanai-2") - Notebooks
- Google Colab
- Kaggle
davanai 2
A LoRA adapter fine-tuned on microsoft/Phi-4-mini-instruct (3.8B), developed by Vega Aiden Lab.
Model details
- Developed by: Vega Aiden Lab
- Model: davanai 2
- Base model: microsoft/Phi-4-mini-instruct
- Method: LoRA (PEFT), rank 16
Run it locally โ step by step
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.
1. Install the libraries
pip install torch transformers peft accelerate safetensors
2. Log in to Hugging Face
pip install -U "huggingface_hub[cli]"
hf auth login
Paste a token from https://huggingface.co/settings/tokens when asked.
3. Create a file called run.py
from 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))
4. Run it
python run.py
The first run downloads the base model (once, then cached), then prints davanai 2's reply.
Training configuration
- Method: LoRA (PEFT)
- Rank (r): 16
- Alpha: 32
- Dropout: 0.05
- Target modules: qkv_proj, o_proj, gate_up_proj, down_proj
- Downloads last month
- 29
Model tree for emmaoba/davanai-2
Base model
microsoft/Phi-4-mini-instruct