Merge pull request #219 from ebolam/united
Fix for GPT2 breakmodel in the UI
This commit is contained in:
commit
3906cc1bd0
|
@ -1565,11 +1565,14 @@ 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")
|
||||
return utils.num_layers(model_config)
|
||||
|
||||
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
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def get_oai_models(key):
|
||||
vars.oaiapikey = key
|
||||
if vars.model_selected == 'OAI':
|
||||
|
|
Loading…
Reference in New Issue