Spaces:
Build error
Build error
File size: 1,079 Bytes
f35cc94 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
from fastai.text.models.transformer import tfmerXL_lm_config, Activation
# from .vocab import MusicVocab
def default_config():
config = tfmerXL_lm_config.copy()
config['act'] = Activation.GeLU
config['mem_len'] = 512
config['d_model'] = 512
config['d_inner'] = 2048
config['n_layers'] = 16
config['n_heads'] = 8
config['d_head'] = 64
return config
def music_config():
config = default_config()
config['encode_position'] = True
return config
def musicm_config():
config = music_config()
config['d_model'] = 768
config['d_inner'] = 3072
config['n_heads'] = 12
config['d_head'] = 64
config['n_layers'] = 12
return config
def multitask_config():
config = default_config()
config['bias'] = True
config['enc_layers'] = 8
config['dec_layers'] = 8
del config['n_layers']
return config
def multitaskm_config():
config = musicm_config()
config['bias'] = True
config['enc_layers'] = 12
config['dec_layers'] = 12
del config['n_layers']
return config
|