Skip to content

Commit d432b21

Browse files
author
lzhang
committed
Remove unused field, update script path in docs.
1 parent 0fec64b commit d432b21

File tree

6 files changed

+9
-13
lines changed

6 files changed

+9
-13
lines changed

docs/multimodal/minicpmo2.6.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ If there are differences in usage, please refer to the official build [documenta
1313

1414
Clone llama.cpp:
1515
```bash
16-
git clone https://github.com/ggerganov/llama.cpp
16+
git clone https://github.com/ggml-org/llama.cpp
1717
cd llama.cpp
1818
```
1919

@@ -29,8 +29,8 @@ cmake --build build --config Release
2929
Convert PyTorch model to gguf files (You can also download the converted [gguf](https://huggingface.co/openbmb/MiniCPM-o-2_6-gguf) by us)
3030

3131
```bash
32-
python ./tools/mtmd/minicpmv-surgery.py -m ../MiniCPM-o-2_6
33-
python ./tools/mtmd/minicpmv-convert-image-encoder-to-gguf.py -m ../MiniCPM-o-2_6 --minicpmv-projector ../MiniCPM-o-2_6/minicpmv.projector --output-dir ../MiniCPM-o-2_6/ --image-mean 0.5 0.5 0.5 --image-std 0.5 0.5 0.5 --minicpmv_version 4
32+
python ./tools/mtmd/legacy-models/minicpmv-surgery.py -m ../MiniCPM-o-2_6
33+
python ./tools/mtmd/legacy-models/minicpmv-convert-image-encoder-to-gguf.py -m ../MiniCPM-o-2_6 --minicpmv-projector ../MiniCPM-o-2_6/minicpmv.projector --output-dir ../MiniCPM-o-2_6/ --image-mean 0.5 0.5 0.5 --image-std 0.5 0.5 0.5 --minicpmv_version 4
3434
python ./convert_hf_to_gguf.py ../MiniCPM-o-2_6/model
3535

3636
# quantize int4 version

docs/multimodal/minicpmv2.5.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ cmake --build build --config Release
2828
Convert PyTorch model to gguf files (You can also download the converted [gguf](https://huggingface.co/openbmb/MiniCPM-Llama3-V-2_5-gguf) by us)
2929

3030
```bash
31-
python ./tools/mtmd/minicpmv-surgery.py -m ../MiniCPM-Llama3-V-2_5
32-
python ./tools/mtmd/minicpmv-convert-image-encoder-to-gguf.py -m ../MiniCPM-Llama3-V-2_5 --minicpmv-projector ../MiniCPM-Llama3-V-2_5/minicpmv.projector --output-dir ../MiniCPM-Llama3-V-2_5/ --image-mean 0.5 0.5 0.5 --image-std 0.5 0.5 0.5 --minicpmv_version 2
31+
python ./tools/mtmd/legacy-models/minicpmv-surgery.py -m ../MiniCPM-Llama3-V-2_5
32+
python ./tools/mtmd/legacy-models/minicpmv-convert-image-encoder-to-gguf.py -m ../MiniCPM-Llama3-V-2_5 --minicpmv-projector ../MiniCPM-Llama3-V-2_5/minicpmv.projector --output-dir ../MiniCPM-Llama3-V-2_5/ --image-mean 0.5 0.5 0.5 --image-std 0.5 0.5 0.5 --minicpmv_version 2
3333
python ./convert_hf_to_gguf.py ../MiniCPM-Llama3-V-2_5/model
3434

3535
# quantize int4 version

docs/multimodal/minicpmv2.6.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ If there are differences in usage, please refer to the official build [documenta
1212

1313
Clone llama.cpp:
1414
```bash
15-
git clone https://github.com/ggerganov/llama.cpp
15+
git clone https://github.com/ggml-org/llama.cpp
1616
cd llama.cpp
1717
```
1818

@@ -28,8 +28,8 @@ cmake --build build --config Release
2828
Convert PyTorch model to gguf files (You can also download the converted [gguf](https://huggingface.co/openbmb/MiniCPM-V-2_6-gguf) by us)
2929

3030
```bash
31-
python ./tools/mtmd/minicpmv-surgery.py -m ../MiniCPM-V-2_6
32-
python ./tools/mtmd/minicpmv-convert-image-encoder-to-gguf.py -m ../MiniCPM-V-2_6 --minicpmv-projector ../MiniCPM-V-2_6/minicpmv.projector --output-dir ../MiniCPM-V-2_6/ --image-mean 0.5 0.5 0.5 --image-std 0.5 0.5 0.5 --minicpmv_version 3
31+
python ./tools/mtmd/legacy-models/minicpmv-surgery.py -m ../MiniCPM-V-2_6
32+
python ./tools/mtmd/legacy-models/minicpmv-convert-image-encoder-to-gguf.py -m ../MiniCPM-V-2_6 --minicpmv-projector ../MiniCPM-V-2_6/minicpmv.projector --output-dir ../MiniCPM-V-2_6/ --image-mean 0.5 0.5 0.5 --image-std 0.5 0.5 0.5 --minicpmv_version 3
3333
python ./convert_hf_to_gguf.py ../MiniCPM-V-2_6/model
3434

3535
# quantize int4 version

tools/mtmd/clip-impl.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
#define KEY_ATTN_WINDOW_SIZE "clip.vision.window_size"
4646
#define KEY_MINICPMV_VERSION "clip.minicpmv_version"
4747
#define KEY_MINICPMV_QUERY_NUM "clip.minicpmv_query_num"
48-
#define KEY_MINICPMV_PROJ_DIM "clip.minicpmv_projection_dim"
4948

5049
// audio-specific
5150
#define KEY_A_NUM_MEL_BINS "clip.audio.num_mel_bins"

tools/mtmd/clip.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ struct clip_hparams {
202202
bool has_llava_projector = false;
203203
int minicpmv_version = 0;
204204
int32_t minicpmv_query_num = 0; // MiniCPM-V query number
205-
int32_t minicpmv_projection_dim = 0; // MiniCPM-V projection dimension
206205
};
207206

208207
struct clip_layer {
@@ -2106,7 +2105,6 @@ struct clip_model_loader {
21062105
get_u32(KEY_IMAGE_CROP_RESOLUTION, hparams.image_crop_resolution, false);
21072106
get_i32(KEY_MINICPMV_VERSION, hparams.minicpmv_version, false); // legacy
21082107
get_u32(KEY_MINICPMV_QUERY_NUM, hparams.minicpmv_query_num, false);
2109-
get_u32(KEY_MINICPMV_PROJ_DIM, hparams.minicpmv_projection_dim, false);
21102108
if (hparams.minicpmv_query_num == 0) {
21112109
// Fallback to hardcoded values for legacy models
21122110
if (hparams.minicpmv_version == 3) {

tools/mtmd/legacy-models/minicpmv-convert-image-encoder-to-gguf.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ def bytes_to_unicode():
520520
# Read config.json to get actual model configuration
521521
config_path = os.path.join(dir_model, "config.json")
522522
model_config = {}
523-
if os.path.exists(config_path):
523+
if os.path.isfile(config_path):
524524
with open(config_path, "r", encoding="utf-8") as f:
525525
model_config = json.load(f)
526526
print(f"Loaded config from {config_path}")
@@ -681,7 +681,6 @@ def bytes_to_unicode():
681681
query_num = model_config.get("query_num", 0) if model_config else 0
682682
resampler_emb_dim = model_config.get("hidden_size", 0) if model_config else 0
683683
fout.add_uint32("clip.minicpmv_query_num", query_num)
684-
fout.add_uint32("clip.minicpmv_projection_dim", resampler_emb_dim)
685684

686685
if processor is not None:
687686
image_mean = processor.image_processor.image_mean if args.image_mean is None or args.image_mean == default_image_mean else args.image_mean

0 commit comments

Comments
 (0)