Skip to content

Commit

Permalink
llava : avoid changing the original BakLLaVA model (#5577)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
danbev committed Feb 19, 2024
1 parent 4480542 commit 7084755
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions examples/llava/llava-surgery.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,13 @@
clip = {name.replace("vision_tower.vision_tower.", ""): checkpoint[name].float() for name in clip_tensors}
torch.save(clip, f"{args.model}/llava.clip")

# remove these tensors
for name in clip_tensors:
del checkpoint[name]

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


torch.save(checkpoint, path)

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

0 comments on commit 7084755

Please sign in to comment.