mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-02-01 18:16:46 +01:00
Disable breakmodel if we error on the check
This commit is contained in:
parent
d2ff32be32
commit
52e120c706
10
aiserver.py
10
aiserver.py
@ -1566,10 +1566,12 @@ def get_layer_count(model, directory=""):
|
||||
model_config = AutoConfig.from_pretrained(directory, revision=vars.revision, cache_dir="cache")
|
||||
else:
|
||||
model_config = AutoConfig.from_pretrained(model, revision=vars.revision, cache_dir="cache")
|
||||
|
||||
if ((utils.HAS_ACCELERATE and model_config.model_type != 'gpt2') or model_config.model_type in ("gpt_neo", "gptj", "xglm", "opt")) and not vars.nobreakmodel:
|
||||
return utils.num_layers(model_config)
|
||||
else:
|
||||
try:
|
||||
if ((utils.HAS_ACCELERATE and model_config.model_type != 'gpt2') or model_config.model_type in ("gpt_neo", "gptj", "xglm", "opt")) and not vars.nobreakmodel:
|
||||
return utils.num_layers(model_config)
|
||||
else:
|
||||
return None
|
||||
except:
|
||||
return None
|
||||
else:
|
||||
return None
|
||||
|
Loading…
x
Reference in New Issue
Block a user