zipslicer icon indicating copy to clipboard operation
zipslicer copied to clipboard

Can we please have a more detailed example on how to load weights one by one for inferencing?

Open randaller opened this issue 1 year ago • 0 comments

For example, transformers model; I assume this is not enough:

model = Transformer(model_args)
model.state_dict = zipslicer.load(checkpoints[-1], map_location="cpu", debug=True)
model.to("cuda")

As it throws out of memory error. How to pass weights for inference one by one?

randaller avatar Mar 07 '23 12:03 randaller