mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Add 4bit plugin
This commit is contained in:
@@ -25,8 +25,12 @@ from modeling.inference_models.hf_torch import HFTorchInferenceModel
|
||||
|
||||
model_backend_name = "Huggingface"
|
||||
|
||||
class GenericHFTorchInferenceModel(HFTorchInferenceModel):
|
||||
def load_config(self) -> None:
|
||||
class model_backend(HFTorchInferenceModel):
|
||||
|
||||
def _initialize_model(self):
|
||||
return
|
||||
|
||||
def _load(self, save_model: bool, initial_load: bool) -> None:
|
||||
utils.koboldai_vars.allowsp = True
|
||||
|
||||
# Make model path the same as the model name to make this consistent
|
||||
@@ -243,11 +247,6 @@ class GenericHFTorchInferenceModel(HFTorchInferenceModel):
|
||||
)
|
||||
shutil.rmtree("cache/")
|
||||
|
||||
if not self.lazy_load:
|
||||
utils.layers_module_names = utils.get_layers_module_names(self.model)
|
||||
utils.module_names = list(self.model.state_dict().keys())
|
||||
utils.named_buffers = list(self.model.named_buffers(recurse=True))
|
||||
|
||||
self.patch_embedding()
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user