Downloads · 30 days
10
8% of all-time downloads
phammminhhieu/mamba-hypernetwork-personalization
mamba-hypernetwork-personalization is a machine learning model from phammminhhieu. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Mamba Hypernetwork sinh LoRA delta cho LLM tại inference time, cho phép cá nhân hóa tức thì mà không cần retrain.
Downloads · 30 days
10
8% of all-time downloads
All-time downloads
130
Public
Repo size
12 GB
Likes
0
Public
Click a slice to open those files.
.bin6 GB · 100%
From the Hugging Face model README
Mamba Hypernetwork sinh LoRA delta cho LLM tại inference time, cho phép cá nhân hóa tức thì mà không cần retrain.
phammminhhieu/persona-reward-modelfrom mamba_ssm import Mamba
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
# Load Mamba
config = json.load(open("config.json"))
mamba = MambaHypernetwork(config)
mamba.load_state_dict(torch.load("pytorch_model.bin"))
mamba.eval()
# Load LLM
llm = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.2-3B-Instruct")
tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-3.2-3B-Instruct")
# Sinh delta từ persona
persona = "I love dogs. I am a photographer."
deltas = mamba(persona_ids, persona_mask, history_ids, history_mask)