Add rope_freq_base parameter for CodeLlama

This commit is contained in:
oobabooga 2023-08-25 06:53:37 -07:00
parent feecd8190f
commit 52ab2a6b9e
10 changed files with 26 additions and 17 deletions

View file

@ -7,7 +7,7 @@ from torch.nn import CrossEntropyLoss
from transformers import GenerationConfig, PretrainedConfig, PreTrainedModel
from transformers.modeling_outputs import CausalLMOutputWithPast
from modules import shared
from modules import RoPE, shared
from modules.logging_colors import logger
try:
@ -134,8 +134,8 @@ class ExllamaHF(PreTrainedModel):
config.set_auto_map(shared.args.gpu_split)
config.gpu_peer_fix = True
if shared.args.alpha_value:
config.alpha_value = shared.args.alpha_value
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)
config.calculate_rotary_embedding_base()
if torch.version.hip: