Fix for badwordIDs

This commit is contained in:
ebolam
2023-05-11 14:14:52 -04:00
parent 4605d10c37
commit e9c845dc2a
3 changed files with 3 additions and 2 deletions

View File

@@ -43,7 +43,7 @@ class model_loader(HFTorchInferenceModel):
self.model_name = os.path.basename(
os.path.normpath(utils.koboldai_vars.custmodpth)
)
utils.koboldai_vars.model = self.model_name
utils.koboldai_vars.model = self.model_name
# If we specify a model and it's in the root directory, we need to move
# it to the models directory (legacy folder structure to new)

View File

@@ -17,6 +17,7 @@ class HFInferenceModel(InferenceModel):
self.model = None
self.tokenizer = None
self.badwordsids = koboldai_settings.badwordsids_default
def is_valid(self, model_name, model_path, menu_path):
try:

View File

@@ -245,7 +245,7 @@ class HFTorchInferenceModel(HFInferenceModel):
len(prompt_tokens) + max_new, utils.koboldai_vars.max_length
),
repetition_penalty=1.0,
bad_words_ids=utils.koboldai_vars.badwordsids
bad_words_ids=self.badwordsids
+ additional_bad_words_ids,
use_cache=True,
num_return_sequences=batch_count,