dropbox-dash/Phi-4-mini-instruct_gemlite-ao_a16w4_gs_128_pack_16bit

🤗 Hugging Face 来源text-generationmit3.0 GBother✓ 2 个校验和今天更新
一条命令提交

在你的模型文件夹旁边运行它。它会制作种子、将文件与 Hugging Face 比对,然后提交。你只需开始做种,并粘贴你账户中的密钥。它只读取你的文件,绝不修改。如果愿意,可以先阅读脚本。

curl -fsSL https://pirateface.co/package.sh | bash -s -- --repo dropbox-dash/Phi-4-mini-instruct_gemlite-ao_a16w4_gs_128_pack_16bit ./model-folder
需要做种者 →

This is an HQQ all 4-bit (group-size=128) quantized Phi-4-mini-instruct model, via TorchAO and GemLite as a backend.

Usage

First, install the dependecies:

pip install torchao;
pip install git+https://github.com/mobiusml/gemlite.git;

Then you can use the sample code below:

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, HqqConfig 

model_id = "mobiuslabsgmbh/Phi-4-mini-instruct_gemlite-ao_a16w4_gs_128_pack_16bit"
model = AutoModelForCausalLM.from_pretrained(
    model_id, 
    torch_dtype=torch.float16, 
    device_map='cuda', 
)

tokenizer = AutoTokenizer.from_pretrained(model_id)

Use in vLLM:

from vllm import LLM
from vllm.sampling_params import SamplingParams

model_id = "mobiuslabsgmbh/Phi-4-mini-instruct_gemlite-ao_a16w4_gs_128_pack_16bit"

llm = LLM(model=model_id, max_model_len=4096)
sampling_params = SamplingParams(temperature=0.8, top_p=0.95, max_tokens=1024)
outputs = llm.generate(["What is the capital of Germany?"], sampling_params)
print(outputs[0].outputs[0].text)