mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-10-01 01:26:03 -04:00
Fix ctransformers model unload (#3711)
Add missing comma in model types list Fixes marella/ctransformers#111
This commit is contained in:
parent
0c9e818bb8
commit
e4c3e1bdd2
@ -10,8 +10,8 @@ class CtransformersModel:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_pretrained(self, path):
|
def from_pretrained(cls, path):
|
||||||
result = self()
|
result = cls()
|
||||||
|
|
||||||
config = AutoConfig.from_pretrained(
|
config = AutoConfig.from_pretrained(
|
||||||
str(path),
|
str(path),
|
||||||
@ -24,13 +24,13 @@ class CtransformersModel:
|
|||||||
mlock=shared.args.mlock
|
mlock=shared.args.mlock
|
||||||
)
|
)
|
||||||
|
|
||||||
self.model = AutoModelForCausalLM.from_pretrained(
|
result.model = AutoModelForCausalLM.from_pretrained(
|
||||||
str(result.model_dir(path) if result.model_type_is_auto() else path),
|
str(result.model_dir(path) if result.model_type_is_auto() else path),
|
||||||
model_type=(None if result.model_type_is_auto() else shared.args.model_type),
|
model_type=(None if result.model_type_is_auto() else shared.args.model_type),
|
||||||
config=config
|
config=config
|
||||||
)
|
)
|
||||||
|
|
||||||
logger.info(f'Using ctransformers model_type: {self.model.model_type} for {self.model.model_path}')
|
logger.info(f'Using ctransformers model_type: {result.model.model_type} for {result.model.model_path}')
|
||||||
return result, result
|
return result, result
|
||||||
|
|
||||||
def model_type_is_auto(self):
|
def model_type_is_auto(self):
|
||||||
|
@ -304,7 +304,7 @@ loaders_model_types = {
|
|||||||
"gptneox",
|
"gptneox",
|
||||||
"llama",
|
"llama",
|
||||||
"mpt",
|
"mpt",
|
||||||
"dollyv2"
|
"dollyv2",
|
||||||
"replit",
|
"replit",
|
||||||
"starcoder",
|
"starcoder",
|
||||||
"gptbigcode",
|
"gptbigcode",
|
||||||
|
Loading…
Reference in New Issue
Block a user