Downloads · 30 days
0
binhquoc/alm-add-phi4-non
alm-add-phi4-non is a machine learning model from binhquoc. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
0
Access
Public
Updated Dec 28, 2025
Repo size
923 MB
Likes
0
Public
Click a slice to open those files.
.safetensors923 MB · 100%
From the Hugging Face model README
import torch
from peft import PeftModel
from transformers import AutoProcessor, AutoModelForCausalLM
def create_model(model_name_or_path = 'microsoft/Phi-4-multimodal-instruct'):
model = AutoModelForCausalLM.from_pretrained(
model_name_or_path,
device_map="auto",
trust_remote_code=True,
cache_dir = os.getenv('CACHE_DIR'),
_attn_implementation='sdpa',
torch_dtype = torch.bfloat16
)
return model
model_name_or_path = 'microsoft/Phi-4-multimodal-instruct'
model = create_model(model_name_or_path)
model.load_adapter("binhquoc/alm-add-phi4-non", adapter_name="speech")
model.set_adapter("speech")
processor = AutoProcessor.from_pretrained(
model_name_or_path,
trust_remote_code=True,
cache_dir = os.getenv('CACHE_DIR'),
)