Skip to content

Commit

Permalink
Only 1 image
Browse files Browse the repository at this point in the history
  • Loading branch information
li-plus committed Jul 25, 2024
1 parent 39a9913 commit cc0f3a8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 29 deletions.
37 changes: 8 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,37 +191,16 @@ python3 chatglm_cpp/convert.py -i THUDM/glm-4-9b-chat -t q4_0 -o models/chatglm4
<details open>
<summary>ChatGLM4V-9B</summary>

You may use `-vt <vision_type>` to set quantization type for the vision encoder. It is recommended to run GLM4V on GPU since vision encoder runs slowly on CPU even with 4-bit quantization.
```
python3 chatglm_cpp/convert.py -i THUDM/glm-4v-9b -t q4_0 -vt q4_0 -o models/chatglm4v-ggml.bin
```

<table>
<tr>
<td style="width: 50%;"><img src="examples/03-Confusing-Pictures.jpg"></td>
<td style="width: 50%;"><img src="examples/hmmm.jpg"></td>
</tr>
[![03-Confusing-Pictures](examples/03-Confusing-Pictures.jpg)](https://www.barnorama.com/wp-content/uploads/2016/12/03-Confusing-Pictures.jpg)

<tr>
<td style="width: 50%;">
<pre>
<code class="language-shell">
You may use `-vt <vision_type>` to set quantization type for the vision encoder. It is recommended to run GLM4V on GPU since vision encoding runs too slow on CPU even with 4-bit quantization.
```sh
python3 chatglm_cpp/convert.py -i THUDM/glm-4v-9b -t q4_0 -vt q4_0 -o models/chatglm4v-ggml.bin
./build/bin/main -m models/chatglm4v-ggml.bin --image examples/03-Confusing-Pictures.jpg -p "这张图片有什么不寻常之处" --temp 0
# 这张图片中不寻常的是,一个男人站在一辆黄色SUV的后备箱上,正在使用一个铁板熨烫衣物。通常情况下,熨衣是在室内进行的,使用的是家用电熨斗,而不是在户外使用汽车后备箱作为工作台。此外,他似乎是在一个繁忙的城市街道上,周围有行驶的车辆和建筑物,这增加了场景的荒谬性。
</code>
</pre>
</td>

<td style="width: 50%;">
<pre>
<code class="language-shell">
./build/bin/main -m models/chatglm4v-ggml.bin --image examples/hmmm.jpg -p "这幅图像有什么好笑的?" --temp 0
# 这幅图像的幽默之处在于它将现代技术与过时的技术并置。智能手机是现代技术的象征,但在这里,它却被连接到一个看起来像是旧式电脑串行端口的蓝色适配器上。这种组合出人意料,颇具幽默感,因为它将两个截然不同的技术时代混合在一起。
</code>
</pre>
</td>
</tr>
</table>
# 这张图片中不寻常的是,一个男人站在一辆黄色SUV的后备箱上,正在使用一个铁板熨烫衣物。
# 通常情况下,熨衣是在室内进行的,使用的是家用电熨斗,而不是在户外使用汽车后备箱作为工作台。
# 此外,他似乎是在一个繁忙的城市街道上,周围有行驶的车辆和建筑物,这增加了场景的荒谬性。
```

</details>

Expand Down
Binary file removed examples/hmmm.jpg
Binary file not shown.

0 comments on commit cc0f3a8

Please sign in to comment.