RAM optimizations and faster launch
This commit is contained in:
@@ -519,8 +519,11 @@ class CLIPModel:
|
||||
device=device)
|
||||
self.model = self.model.eval().requires_grad_(False)
|
||||
logging.info(f'loading {checkpoint_path}')
|
||||
self.model.load_state_dict(
|
||||
torch.load(checkpoint_path, map_location='cpu'), assign= True)
|
||||
from mmgp import offload
|
||||
# self.model.load_state_dict(
|
||||
# torch.load(checkpoint_path, map_location='cpu'), assign= True)
|
||||
|
||||
offload.load_model_data(self.model, checkpoint_path.replace(".pth", "-bf16.safetensors"), writable_tensors= False)
|
||||
|
||||
# init tokenizer
|
||||
self.tokenizer = HuggingfaceTokenizer(
|
||||
|
||||
Reference in New Issue
Block a user