Skip to content

Commit

Permalink
fix Type-Check error
Browse files Browse the repository at this point in the history
  • Loading branch information
tc-mb committed Aug 7, 2024
1 parent 28230d0 commit e3eff2a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions examples/llava/minicpmv-convert-image-encoder-to-gguf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
VISION = "clip.vision"


def k(raw_key: str, arch: str) -> str:
def add_key_str(raw_key: str, arch: str) -> str:
return raw_key.format(arch=arch)


Expand Down Expand Up @@ -196,13 +196,13 @@ def bytes_to_unicode():
# vision_model hparams
fout.add_uint32("clip.vision.image_size", 448)
fout.add_uint32("clip.vision.patch_size", 14)
fout.add_uint32(k(KEY_EMBEDDING_LENGTH, VISION), 1152)
fout.add_uint32(k(KEY_FEED_FORWARD_LENGTH, VISION), 4304)
fout.add_uint32(add_key_str(KEY_EMBEDDING_LENGTH, VISION), 1152)
fout.add_uint32(add_key_str(KEY_FEED_FORWARD_LENGTH, VISION), 4304)
fout.add_uint32("clip.vision.projection_dim", 0)
fout.add_uint32(k(KEY_ATTENTION_HEAD_COUNT, VISION), 16)
fout.add_float32(k(KEY_ATTENTION_LAYERNORM_EPS, VISION), 1e-6)
fout.add_uint32(add_key_str(KEY_ATTENTION_HEAD_COUNT, VISION), 16)
fout.add_float32(add_key_str(KEY_ATTENTION_LAYERNORM_EPS, VISION), 1e-6)
block_count = 26
fout.add_uint32(k(KEY_BLOCK_COUNT, VISION), block_count)
fout.add_uint32(add_key_str(KEY_BLOCK_COUNT, VISION), block_count)

if processor is not None:
image_mean = processor.image_processor.image_mean if args.image_mean is None or args.image_mean == default_image_mean else args.image_mean
Expand Down

0 comments on commit e3eff2a

Please sign in to comment.