lianglv commited on
Commit
949d786
·
verified ·
1 Parent(s): e0b001f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +93 -3
README.md CHANGED
@@ -1,3 +1,93 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model:
3
+ - zai-org/GLM-Image
4
+ tags:
5
+ - Text-to-Image
6
+ license: mit
7
+ ---
8
+ ## Model Details
9
+
10
+ This 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 inference
13
+
14
+ **Setup**
15
+ ~~~bash
16
+ pip install git+https://github.com/yiliu30/vllm-omni-fork.git@feats/ar-w4a16
17
+ pip install git+https://github.com/huggingface/transformers.git
18
+ ~~~
19
+
20
+
21
+ ~~~bash
22
+ CUDA_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
+
24
+ curl http://localhost:8091/v1/chat/completions \
25
+ -H "Content-Type: application/json" \
26
+ -d '{
27
+ "messages": [{"role": "user", "content": [{"type": "text", "text": "<|im_start|>A beautiful sunset over mountains<|im_end|>"}]}],
28
+ "modalities": ["image"],
29
+ "height": 512,
30
+ "width": 512,
31
+ "num_inference_steps": 50,
32
+ "seed": 42
33
+ }'
34
+
35
+ IMAGE_BASE64=$(base64 -w 0 cat.jpg)
36
+
37
+ cat <<EOF > payload.json
38
+ {
39
+ "messages": [{
40
+ "role": "user",
41
+ "content": [
42
+ {"type": "text", "text": "<|im_start|>Make the cat stand up<|im_end|>"},
43
+ {"type": "image_url", "image_url": {"url": "data:image/jpeg;base64,${IMAGE_BASE64}"}}
44
+ ]
45
+ }],
46
+ "modalities": ["image"],
47
+ "height": 512,
48
+ "width": 512,
49
+ "num_inference_steps": 50,
50
+ "seed": 42
51
+ }
52
+ EOF
53
+
54
+ curl http://localhost:8091/v1/chat/completions \
55
+ -H "Content-Type: application/json" \
56
+ -d @payload.json
57
+ ~~~
58
+
59
+
60
+ ## Generate the Model
61
+
62
+ ~~~bash
63
+ auto_round \
64
+ --model zai-org/GLM-Image \
65
+ --output_dir tmp_glm_image_w4a16 \
66
+ --trust_remote_code
67
+ ~~~
68
+
69
+
70
+
71
+ ## Ethical Considerations and Limitations
72
+
73
+ 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.
74
+
75
+ Therefore, before deploying any applications of the model, developers should perform safety testing.
76
+
77
+ ## Caveats and Recommendations
78
+
79
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.
80
+
81
+ Here are a couple of useful links to learn more about Intel's AI software:
82
+
83
+ - [Intel Neural Compressor](https://github.com/intel/neural-compressor)
84
+
85
+ ## Disclaimer
86
+
87
+ 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.
88
+
89
+ ## Cite
90
+
91
+ @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} }
92
+
93
+ [arxiv](https://arxiv.org/abs/2309.05516) [github](https://github.com/intel/auto-round)