Model Details

This model is an W4A16 model with group_size 128 of stepfun-ai/NextStep-1.1 generated by intel/auto-round. Please follow the license of the original model.

Infernece Example

hf download INCModel/NextStep-1.1-W4A16-AutoRound  /workspace/models/stepfun-ai/NextStep-1.1-W4A16/
export PYTHONPATH=/workspace/models/stepfun-ai/NextStep-1.1-W4A16/
cd /workspace/models/stepfun-ai/NextStep-1.1-W4A16/
uv pip install transformers==4.57.6
uv pip install gptqmodel==5.8.0 --no-build-isolation
python run_generation.py
# run_generation.py
import torch
from transformers import AutoTokenizer, AutoModel
from models.gen_pipeline import NextStepPipeline

HF_HUB = "INCModel/NextStep-1.1-W4A16-AutoRound"

# load model and tokenizer
tokenizer = AutoTokenizer.from_pretrained(HF_HUB, local_files_only=True, trust_remote_code=True)

# set device_map="cuda" to leverage gptqmodel kernels
model = AutoModel.from_pretrained(HF_HUB, local_files_only=True, trust_remote_code=True, device_map="cuda")
print(model)  # Ensure that MarlinQuantLinear() is loaded
pipeline = NextStepPipeline(tokenizer=tokenizer, model=model).to(device="cuda", dtype=torch.bfloat16)

# set prompts
positive_prompt = ""
negative_prompt = "lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry."
example_prompt = "A REALISTIC PHOTOGRAPH OF A WALL WITH \"TOWARD AUTOREGRESSIVE IMAGE GENERATION WITH CONTINUOUS TOKENS AT SCALE\" PROMINENTLY DISPLAYED"

# generate image from text
IMG_SIZE = 512
image = pipeline.generate_image(
    example_prompt,
    hw=(IMG_SIZE, IMG_SIZE),
    num_images_per_caption=1,
    positive_prompt=positive_prompt,
    negative_prompt=negative_prompt,
    cfg=7.5,
    cfg_img=1.0,
    cfg_schedule="constant",
    use_norm=False,
    num_sampling_steps=28,
    timesteps_shift=1.0,
    seed=3407,
)[0]
image.save("./output.jpg")

Demo Results

stepfun-ai/NextStep-1.1:

nextstep-output

INCModel/NextStep-1.1-W4A16-AutoRound:

int4-output

Generate the Model

This pr is required https://github.com/intel/auto-round/pull/1640

Tuning version

hf download stepfun-ai/NextStep-1.1  /workspace/models/stepfun-ai/NextStep-1.1
export PYTHONPATH=/workspace/models/stepfun-ai/NextStep-1.1/
cd /workspace/models/stepfun-ai/NextStep-1.1/
auto-round /workspace/models/stepfun-ai/NextStep-1.1/  --output_dir "/workspace/models/stepfun-ai/NextStep-1.1-W4A16" --num_inference_steps 1

Ethical Considerations and Limitations

The model can produce factually incorrect output, and should not be relied on to produce factually accurate information. Because of the limitations of the pretrained model and the finetuning datasets, it is possible that this model could generate lewd, biased or otherwise offensive outputs.

Therefore, before deploying any applications of the model, developers should perform safety testing.

Caveats and Recommendations

Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.

Here are a couple of useful links to learn more about Intel's AI software:

Disclaimer

The license on this model does not constitute legal advice. We are not responsible for the actions of third parties who use this model. Please consult an attorney before using this model for commercial purposes.

Cite

@article{cheng2023optimize, title={Optimize weight rounding via signed gradient descent for the quantization of llms}, author={Cheng, Wenhua and Zhang, Weiwei and Shen, Haihao and Cai, Yiyang and He, Xin and Lv, Kaokao and Liu, Yi}, journal={arXiv preprint arXiv:2309.05516}, year={2023} }

arxiv github

Downloads last month
18
Safetensors
Model size
3B params
Tensor type
I32
·
BF16
·
F16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for INCModel/NextStep-1.1-W4A16-AutoRound

Quantized
(1)
this model

Paper for INCModel/NextStep-1.1-W4A16-AutoRound