Downloads · 30 days
22
4% of all-time downloads
yibinlei/effir-mistral-drop-8-mlp
effir-mistral-drop-8-mlp is a text generation model from yibinlei. Use it when you need the model to write or continue text. It is set up for transformers.
EffiR Mistral dense retriever with direct layer dropping.
Downloads · 30 days
22
4% of all-time downloads
All-time downloads
546
Public
Parameters
7.2B
16.9 GB on disk
Likes
3
Public
Click a slice to open those files.
.safetensors15.1 GB · 97%
From the Hugging Face model README
EffiR Mistral dense retriever with direct layer dropping.
Use trust_remote_code=True.
from transformers import AutoConfig, AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
from huggingface_hub import hf_hub_download
import torch
repo = "yibinlei/effir-mistral-drop-8-mlp"
tokenizer = AutoTokenizer.from_pretrained(repo, trust_remote_code=True)
config = AutoConfig.from_pretrained(repo, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
repo,
config=config,
trust_remote_code=True,
attn_implementation="eager",
torch_dtype=torch.bfloat16,
)
input_emb_path = hf_hub_download(repo, "embedding/input_emb.pth")
model.set_input_embeddings(torch.load(input_emb_path, map_location="cpu"))
model = PeftModel.from_pretrained(model, repo)
model = model.merge_and_unload()