Intel/GLM-Image-int4-AutoRound
425
1---2base_model:3- zai-org/GLM-Image4tags:5- Text-to-Image6license: mit7---8## Model Details9 10This model is a mixed int4 model with group_size 128 and symmetric quantization of [zai-org/GLM-Image](https://huggingface.co/zai-org/GLM-Image/) generated by [intel/auto-round](https://github.com/intel/auto-round). Please follow the license of the original model.11 12## vllm-omni inference13 14**Setup**15~~~bash16pip install git+https://github.com/lvliang-intel/vllm-omni.git@feats/ar-w4a16-glm-image17pip install git+https://github.com/huggingface/transformers.git18~~~19 20 21~~~bash22CUDA_VISIBLE_DEVICES=0 vllm serve Intel/GLM-Image-int4-AutoRound --omni --stage-configs-path <your_vllm_omni_path>/vllm_omni/model_executor/stage_configs/glm_image.yaml --port 8091 23 24curl -s http://127.0.0.1:8091/v1/chat/completions \25 -H "Content-Type: application/json" \26 -d '{27 "messages": [28 {"role": "user", "content": "A beautiful sunset over the ocean with sailing boats"}29 ],30 "extra_body": {31 "height": 1024,32 "width": 1024,33 "num_inference_steps": 50,34 "guidance_scale": 1.5,35 "seed": 4236 }37 }' | jq -r '.choices[0].message.content[0].image_url.url' | cut -d',' -f2- | base64 -d > sunset.png38 39IMG_B64=$(base64 -w0 sunset.png)40 41curl -s http://localhost:8091/v1/chat/completions \42 -H "Content-Type: application/json" \43 -d @- <<EOF | jq -r '.choices[0].message.content[0].image_url.url' | cut -d',' -f2- | base64 -d > watercolor.png44{45 "messages": [{46 "role": "user",47 "content": [48 {"type": "text", "text": "Convert this image to watercolor style"},49 {"type": "image_url", "image_url": {"url": "data:image/png;base64,$IMG_B64"}}50 ]51 }],52 "extra_body": {53 "height": 1024,54 "width": 102455 }56}57EOF58~~~59 60 61## Generate the Model62 63~~~bash64auto_round \65 --model zai-org/GLM-Image \66 --output_dir tmp_glm_image_w4a16 \67 --trust_remote_code68~~~69 70 71 72## Ethical Considerations and Limitations73 74The 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.75 76Therefore, before deploying any applications of the model, developers should perform safety testing.77 78## Caveats and Recommendations79 80Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.81 82Here are a couple of useful links to learn more about Intel's AI software:83 84- [Intel Neural Compressor](https://github.com/intel/neural-compressor)85 86## Disclaimer87 88The 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.89 90## Cite91 92@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} }93 94[arxiv](https://arxiv.org/abs/2309.05516) [github](https://github.com/intel/auto-round)