mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Fix for badwordIDs
This commit is contained in:
@@ -43,7 +43,7 @@ class model_loader(HFTorchInferenceModel):
|
|||||||
self.model_name = os.path.basename(
|
self.model_name = os.path.basename(
|
||||||
os.path.normpath(utils.koboldai_vars.custmodpth)
|
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
|
# 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)
|
# it to the models directory (legacy folder structure to new)
|
||||||
|
@@ -17,6 +17,7 @@ class HFInferenceModel(InferenceModel):
|
|||||||
|
|
||||||
self.model = None
|
self.model = None
|
||||||
self.tokenizer = None
|
self.tokenizer = None
|
||||||
|
self.badwordsids = koboldai_settings.badwordsids_default
|
||||||
|
|
||||||
def is_valid(self, model_name, model_path, menu_path):
|
def is_valid(self, model_name, model_path, menu_path):
|
||||||
try:
|
try:
|
||||||
|
@@ -245,7 +245,7 @@ class HFTorchInferenceModel(HFInferenceModel):
|
|||||||
len(prompt_tokens) + max_new, utils.koboldai_vars.max_length
|
len(prompt_tokens) + max_new, utils.koboldai_vars.max_length
|
||||||
),
|
),
|
||||||
repetition_penalty=1.0,
|
repetition_penalty=1.0,
|
||||||
bad_words_ids=utils.koboldai_vars.badwordsids
|
bad_words_ids=self.badwordsids
|
||||||
+ additional_bad_words_ids,
|
+ additional_bad_words_ids,
|
||||||
use_cache=True,
|
use_cache=True,
|
||||||
num_return_sequences=batch_count,
|
num_return_sequences=batch_count,
|
||||||
|
Reference in New Issue
Block a user