Merge branch 'master' of https://github.com/ai-doge/llama2.c into ai-doge-master
This commit is contained in:
@@ -56,12 +56,12 @@ def export(p, state_dict, filepath='model.bin'):
|
||||
|
||||
# final rmsnorm
|
||||
serialize('norm.weight')
|
||||
# freqs_cis
|
||||
freqs_cis = precompute_freqs_cis(p['dim'] // p['n_heads'], p['max_seq_len'] * 2)
|
||||
state_dict['freqs_cis.real'] = freqs_cis.real[:p['max_seq_len']]
|
||||
state_dict['freqs_cis.imag'] = freqs_cis.imag[:p['max_seq_len']]
|
||||
serialize('freqs_cis.real')
|
||||
serialize('freqs_cis.imag')
|
||||
# freqs_cos, freqs_sin
|
||||
freqs_cos, freqs_sin = precompute_freqs_cis(p['dim'] // p['n_heads'], p['max_seq_len'] * 2)
|
||||
state_dict['freqs_cos'] = freqs_cos[:p['max_seq_len']]
|
||||
state_dict['freqs_sin'] = freqs_sin[:p['max_seq_len']]
|
||||
serialize('freqs_cos')
|
||||
serialize('freqs_sin')
|
||||
|
||||
# finally write the output weights
|
||||
serialize('output.weight')
|
||||
|
||||
Reference in New Issue
Block a user