CoolFace
Modelpublic

Intel/GLM-Image-int4-AutoRound

sourceHugging Facemitupdated 5mo agoView on Hugging Face
4likes25downloads
Model Card

Model Details

This model is a mixed int4 model with group_size 128 and symmetric quantization of zai-org/GLM-Image generated by intel/auto-round. Please follow the license of the original model.

vllm-omni inference

Setup ~~~bash pip install git+https://github.com/lvliang-intel/vllm-omni.git@feats/ar-w4a16-glm-image pip install git+https://github.com/huggingface/transformers.git ~~~

~~~bash CUDAVISIBLEDEVICES=0 vllm serve Intel/GLM-Image-int4-AutoRound --omni --stage-configs-path <yourvllmomnipath>/vllmomni/modelexecutor/stageconfigs/glm_image.yaml --port 8091

curl -s http://127.0.0.1:8091/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{ "messages": [ {"role": "user", "content": "A beautiful sunset over the ocean with sailing boats"} ], "extrabody": { "height": 1024, "width": 1024, "numinferencesteps": 50, "guidancescale": 1.5, "seed": 42 } }' | jq -r '.choices[0].message.content[0].image_url.url' | cut -d',' -f2- | base64 -d > sunset.png

IMG_B64=$(base64 -w0 sunset.png)

curl -s http://localhost:8091/v1/chat/completions \ -H "Content-Type: application/json" \ -d @- <<EOF | jq -r '.choices[0].message.content[0].imageurl.url' | cut -d',' -f2- | base64 -d > watercolor.png { "messages": [{ "role": "user", "content": [ {"type": "text", "text": "Convert this image to watercolor style"}, {"type": "imageurl", "imageurl": {"url": "data:image/png;base64,$IMGB64"}} ] }], "extra_body": { "height": 1024, "width": 1024 } } EOF ~~~

Generate the Model

~~~bash autoround \ --model zai-org/GLM-Image \ --outputdir tmpglmimagew4a16 \ --trustremote_code ~~~

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