Exllama new rope settings (#3852)

This commit is contained in:
Forkoz 2023-09-11 04:14:36 +00:00 committed by GitHub
parent 859b4fd737
commit 15e9b8c915
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View File

@ -56,9 +56,11 @@ class ExllamaModel:
config.set_auto_map(shared.args.gpu_split)
config.gpu_peer_fix = True
if shared.args.alpha_value > 1 or shared.args.rope_freq_base > 0:
config.alpha_value = RoPE.get_alpha_value(shared.args.alpha_value, shared.args.rope_freq_base)
if shared.args.alpha_value > 1 and shared.args.rope_freq_base == 0:
config.alpha_value = shared.args.alpha_value
config.calculate_rotary_embedding_base()
elif shared.args.rope_freq_base > 0:
config.rotary_embedding_base = shared.args.rope_freq_base
if torch_version.hip:
config.rmsnorm_no_half2 = True

View File

@ -134,9 +134,11 @@ class ExllamaHF(PreTrainedModel):
config.set_auto_map(shared.args.gpu_split)
config.gpu_peer_fix = True
if shared.args.alpha_value > 1 or shared.args.rope_freq_base > 0:
config.alpha_value = RoPE.get_alpha_value(shared.args.alpha_value, shared.args.rope_freq_base)
if shared.args.alpha_value > 1 and shared.args.rope_freq_base == 0:
config.alpha_value = shared.args.alpha_value
config.calculate_rotary_embedding_base()
elif shared.args.rope_freq_base > 0:
config.rotary_embedding_base = shared.args.rope_freq_base
if torch.version.hip:
config.rmsnorm_no_half2 = True