mirror of
				https://github.com/ggml-org/llama.cpp.git
				synced 2025-10-30 08:42:00 +00:00 
			
		
		
		
	llava : avoid changing the original BakLLaVA model (#5577)
This is a follup of Commit fc0c8d286a
("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 <daniel.bevenius@gmail.com>
			
			
This commit is contained in:
		| @@ -25,9 +25,6 @@ if len(clip_tensors) > 0: | |||||||
|     clip = {name.replace("vision_tower.vision_tower.", ""): checkpoint[name].float() for name in clip_tensors} |     clip = {name.replace("vision_tower.vision_tower.", ""): checkpoint[name].float() for name in clip_tensors} | ||||||
|     torch.save(clip, f"{args.model}/llava.clip") |     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 |     # added tokens should be removed to be able to convert Mistral models | ||||||
|     if os.path.exists(f"{args.model}/added_tokens.json"): |     if os.path.exists(f"{args.model}/added_tokens.json"): | ||||||
| @@ -35,7 +32,6 @@ if len(clip_tensors) > 0: | |||||||
|             f.write("{}\n") |             f.write("{}\n") | ||||||
|  |  | ||||||
|  |  | ||||||
|     torch.save(checkpoint, path) |  | ||||||
|  |  | ||||||
| print("Done!") | print("Done!") | ||||||
| print(f"Now you can convert {args.model} to a regular LLaMA GGUF file.") | print(f"Now you can convert {args.model} to a regular LLaMA GGUF file.") | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Daniel Bevenius
					Daniel Bevenius