OPT breakmodel

This commit is contained in:
Gnome Ann
2022-05-13 01:03:38 -04:00
parent b1d8797a54
commit defbb53b68
3 changed files with 220 additions and 17 deletions

View File

@ -135,6 +135,12 @@ def decodenewlines(txt):
return txt.replace("</s>", '\n')
return txt
#==================================================================#
# Returns number of layers given an HF model config
#==================================================================#
def num_layers(config):
return config.num_layers if hasattr(config, "num_layers") else config.n_layer if hasattr(config, "n_layer") else config.num_hidden_layers
#==================================================================#
# Downloads huggingface checkpoints using aria2c if possible
#==================================================================#