Skip to content

Commit 7084755

Browse files
authored
llava : avoid changing the original BakLLaVA model (#5577)
This is a follup of Commit fc0c8d2 ("llava : update surgery script to not remove tensors") but this time the change is to the BakLLaVA specific part of the surgery script. I've been able to test this using SkunkworksAI/BakLLaVA-1 and it works as expected using the instructions in README.md. Signed-off-by: Daniel Bevenius <[email protected]>
1 parent 4480542 commit 7084755

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

examples/llava/llava-surgery.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,13 @@
2525
clip = {name.replace("vision_tower.vision_tower.", ""): checkpoint[name].float() for name in clip_tensors}
2626
torch.save(clip, f"{args.model}/llava.clip")
2727

28-
# remove these tensors
29-
for name in clip_tensors:
30-
del checkpoint[name]
3128

3229
# added tokens should be removed to be able to convert Mistral models
3330
if os.path.exists(f"{args.model}/added_tokens.json"):
3431
with open(f"{args.model}/added_tokens.json", "w") as f:
3532
f.write("{}\n")
3633

3734

38-
torch.save(checkpoint, path)
3935

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

0 commit comments

Comments
 (0)