Skip to content

Commit 77c580d

Browse files
committed
modify convert script of minicpmv
1 parent 6da5130 commit 77c580d

File tree

4 files changed

+1370
-1
lines changed

4 files changed

+1370
-1
lines changed

examples/llava/minicpmv-convert-image-encoder-to-gguf.py renamed to examples/llava/minicpmv-convert/minicpmv2_5-convert-image-encoder-to-gguf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ def bytes_to_unicode():
166166
fname_middle = "mmproj-"
167167
has_text_encoder = False
168168
has_minicpmv_projector = True
169+
minicpmv_version = 3
169170
elif args.vision_only:
170171
fname_middle = "vision-"
171172
has_text_encoder = False
@@ -190,6 +191,7 @@ def bytes_to_unicode():
190191
fout.add_description("image encoder for MiniCPM-V")
191192
# add projector type
192193
fout.add_string("clip.projector_type", "resampler")
194+
fout.add_int32("clip.minicpmv_version", minicpmv_version)
193195
else:
194196
fout.add_description("two-tower CLIP model")
195197

examples/llava/minicpmv-surgery.py renamed to examples/llava/minicpmv-convert/minicpmv2_5-surgery.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
model.llm.save_pretrained(f"{args.model}/model")
4242
tok = AutoTokenizer.from_pretrained(args.model, trust_remote_code=True)
4343
tok.save_pretrained(f"{args.model}/model")
44-
# os.system(f"cp {args.model}/modeling_minicpm.py {args.model}/MiniCPM_l3/modeling_minicpm.py")
4544

4645
print("Done!")
4746
print(f"Now you can convert {args.model} to a regular LLaMA GGUF file.")

0 commit comments

Comments
 (0)