lianglv commited on
Commit
d89794a
·
verified ·
1 Parent(s): 8ac85fc

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +92 -1
README.md CHANGED
@@ -1,3 +1,94 @@
1
  ---
2
- license: apache-2.0
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ base_model:
3
+ - AIDC-AI/Ovis-Image-7B
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 [AIDC-AI/Ovis-Image-7B](https://huggingface.co/AIDC-AI/Ovis-Image-7B) 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/lvliang-intel/vllm-omni.git@feats/ar-w4a16-ovis-image
17
+ pip install git+https://github.com/huggingface/transformers.git
18
+ ~~~
19
+
20
+
21
+ ~~~bash
22
+ CUDA_VISIBLE_DEVICES=0 vllm serve Intel/Ovis-Image-7B-int4-AutoRound --omni --port 8091
23
+
24
+ curl -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": 42
36
+ }
37
+ }' | jq -r '.choices[0].message.content[0].image_url.url' | cut -d',' -f2- | base64 -d > sunset.png
38
+
39
+ IMG_B64=$(base64 -w0 sunset.png)
40
+
41
+ curl -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.png
44
+ {
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": 1024
55
+ }
56
+ }
57
+ EOF
58
+ ~~~
59
+
60
+
61
+ ## Generate the Model
62
+
63
+ ~~~bash
64
+ auto_round \
65
+ --model AIDC-AI/Ovis-Image-7B \
66
+ --output_dir tmp_ovis_image_w4a16 \
67
+ --trust_remote_code
68
+ ~~~
69
+
70
+
71
+
72
+ ## Ethical Considerations and Limitations
73
+
74
+ 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.
75
+
76
+ Therefore, before deploying any applications of the model, developers should perform safety testing.
77
+
78
+ ## Caveats and Recommendations
79
+
80
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.
81
+
82
+ Here 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
+ ## Disclaimer
87
+
88
+ 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.
89
+
90
+ ## Cite
91
+
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)