Skip to content

Commit 5ab62fe

Browse files
CoryCory
authored andcommitted
For non low_resource llama loading code, I added an argument low_cpu_mem_usage=True, drastically speeding up load time (cuts more than a minute off of load)
1 parent ef1ac08 commit 5ab62fe

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

minigpt4/models/mini_gpt4.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ def __init__(
118118
self.llama_model = LlamaForCausalLM.from_pretrained(
119119
llama_model,
120120
torch_dtype=torch.float16,
121+
low_cpu_mem_usage=True,
121122
)
122123

123124
if lora_r > 0:

0 commit comments

Comments
 (0)