diff options
author | Daniel Bevenius <daniel.bevenius@gmail.com> | 2024-02-21 14:36:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-21 15:36:57 +0200 |
commit | cc6cac08e38e32bf40bbe07e9e8f8f0130b5fd94 (patch) | |
tree | 3753c7d22eee61e818942622cc5ff25e7d55a304 /examples/llava/llava-surgery-v2.py | |
parent | 580111d42b3b6ad0a390bfb267d6e3077506eb31 (diff) |
llava : add --skip-unknown to 1.6 convert.py (#5632)
This commit adds the `--skip-unknown` option to the convert.py script
and removes the saving of the updated checkpoints to avoid updating
possibly checked out files.
The motivation for this change is that this was done for 1.5
in Commit fc0c8d286a533363a9a663510b62af85ffad58b3 ("llava :
update surgery script to not remove tensors") and makes the examples
more consistent.
Signed-off-by: Daniel Bevenius <daniel.bevenius@gmail.com>
Diffstat (limited to 'examples/llava/llava-surgery-v2.py')
-rw-r--r-- | examples/llava/llava-surgery-v2.py | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/examples/llava/llava-surgery-v2.py b/examples/llava/llava-surgery-v2.py index 5bc5bc51..eb56d698 100644 --- a/examples/llava/llava-surgery-v2.py +++ b/examples/llava/llava-surgery-v2.py @@ -65,9 +65,7 @@ def clean_vision_tower_from_checkpoint(checkpoint_path): for name in clip_tensors: del checkpoint[name] - # Save the updated checkpoint checkpoint_path = checkpoint_path - save_model(checkpoint, checkpoint_path, file_type) return True return False @@ -152,16 +150,6 @@ for name in first_mm_tensors: if len(projector) > 0: save_model(projector, f"{args.model}/llava.projector", 'pytorch') -for name in mm_tensors: - del last_checkpoint[name] -for name in first_mm_tensors: - del first_checkpoint[name] - -if len(mm_tensors) > 0: - save_model(last_checkpoint, projector_checkpoint_path, file_type) -if len(first_mm_tensors) > 0: - save_model(first_checkpoint, newline_checkpoint_path, file_type) - print("Done!") print(f"Now you can convert {args.model} to a a regular LLaMA GGUF file.") print(f"Also, use {args.model}/llava.projector to prepare a llava-encoder.gguf file.") |