Model Details

This model is an int4 model with group_size 64 and symmetric quantization of google/diffusiongemma-26B-A4B-it generated by intel/auto-round. Please follow the license of the original model.

Transformes inference

from transformers import (
    AutoConfig,
    AutoProcessor,
    AutoTokenizer,
    DiffusionGemmaGenerationConfig,
    DiffusionGemmaForBlockDiffusion,
)

MODEL_ID = "Intel/diffusiongemma-26B-A4B-it-int4-AutoRound"

config = AutoConfig.from_pretrained(MODEL_ID)
processor = AutoProcessor.from_pretrained(MODEL_ID)
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)

gen_config = DiffusionGemmaGenerationConfig.from_pretrained(MODEL_ID)

model = DiffusionGemmaForBlockDiffusion.from_pretrained(
    MODEL_ID,
    device_map="auto",
    dtype="auto",
    trust_remote_code=False,
)

model.eval()

messages = [{"role": "user", "content": "Why is the sky blue?"}]
input_ids = tokenizer.apply_chat_template(
    messages, tokenize=True, return_dict=True, return_tensors="pt", add_generation_prompt=True
).to(model.device)

output = model.generate(**input_ids, max_new_tokens=256)
response = tokenizer.decode(output[0][input_ids.shape[-1]:], skip_special_tokens=True)
print(response)

{'content': 'An outdoor, daytime, medium shot shows the Golden Gate Bridge spanning a body of water, with a large, tan building in the foreground and hills in the distance. The bridge is a deep red color and is supported by two large towers. The water is a calm, dark blue, and there are some small waves. The building in the foreground is made of tan bricks and has several windows. In the foreground, there is a large rock in the water, and a small bird is perched on top of it. The sky is a clear, light blue. The sun is shining brightly, casting a soft light on the scene.', 'role': 'assistant'}

vLLM inference

please install vLLM with latest source code.

vllm serve Intel/diffusiongemma-26B-A4B-it-int4-AutoRound --port 8088 --gpu-memory-utilization 0.75
curl http://localhost:8088/v1/chat/completions   -H "Content-Type: application/json"   -d '{
    "messages": [{"role": "user", "content": "Why is the sky blue?"}],
    "max_tokens": 256,
    "temperature": 1.0
  }'
{"id":"chatcmpl-a307153d4590a1f3","object":"chat.completion","created":1782479268,"model":"Intel/diffusiongemma-26B-A4B-it-int4-AutoRound","choices":[{"index":0,"message":{"role":"assistant","content":"The sky is blue because of a phenomenon called **Rayleigh scattering**.\n\nHere is the step-by-step breakdown of why this happens:\n\n### 1. Sunlight is made of all colors\nEven though sunlight looks white to us, it is actually made up of all the colors of the rainbow: red, orange, yellow, green, blue, indigo, and violet. Each color travels as a wave with a different **wavelength**.\n*   **Red light** has long, lazy waves.\n*   **Blue and violet light** have short, choppy waves.\n\n### 2. The atmosphere acts as an obstacle\nEarth is surrounded by an atmosphere filled with nitrogen and oxygen gases. When sunlight enters the atmosphere, it hits these gas molecules and scat in all directions.\n\n### 3. Short waves scatter more\nBecause red and yellow light have long wavelengths, they pass through the atmosphere mostly without hitting anything. However, because **blue travels travels in shorter waves**, it crashes into the gas molecules and gets \"scattered\" in every direction. \n\n### 4. Our eyes see blue\nBecause the blue light is being scattered everywhere in the upper atmosphere, when you look up, your eyes are catching all that scattered blue light coming from every","refusal":null,"annotations":null,"audio":null,"function_call":null,"reasoning":null},"logprobs":null,"finish_reason":"length","stop_reason":null,"token_ids":null,"routed_experts":null}],"service_tier":null,"system_fingerprint":"vllm-0.23.1rc1.dev418+g6e3a983cf-ba5bc09d","usage":{"prompt_tokens":19,"total_tokens":275,"completion_tokens":256,"prompt_tokens_details":null},"prompt_logprobs":null,"prompt_token_ids":null,"prompt_text":null,"kv_transfer_params":null}

Generate the Model

https://github.com/intel/auto-round/pull/1935 is required

auto-round-best --model /models/diffusiongemma-26B-A4B-it/ --scheme "W4A16" --group_size 64 --output_dir ./diffusiongemma_int4/

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
25
Safetensors
Model size
9B 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 Intel/diffusiongemma-26B-A4B-it-int4-AutoRound

Quantized
(29)
this model

Paper for Intel/diffusiongemma-26B-A4B-it-int4-AutoRound