This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# %% | |
import torch | |
from transformers import AutoModelForCausalLM, BitsAndBytesConfig | |
# %% | |
import bitsandbytes as bnb # type: ignore | |
def dump_4bit_weight(m: bnb.nn.modules.Linear4bit, path: str): | |
assert isinstance(m, bnb.nn.modules.Linear4bit), "Only Linear4bit is supported" | |
obj = { |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder