Merge pull request #5453 from oobabooga/dev

Merge dev branch
This commit is contained in:
oobabooga 2024-02-06 11:50:21 -03:00 committed by GitHub
commit 0f134bf744
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 6 deletions

View File

@ -120,9 +120,12 @@ def generate_preset_yaml(state):
defaults = default_preset()
data = {k: state[k] for k in presets_params()}
# Remove entries that are identical to the defaults
# Remove entries that are identical to the defaults.
# sampler_priority is always saved because it is experimental
# and the default order may change.
for k in list(data.keys()):
if data[k] == defaults[k]:
if data[k] == defaults[k] and k != 'sampler_priority':
del data[k]
return yaml.dump(data, sort_keys=False)

View File

@ -428,16 +428,15 @@ def get_logits_warper_patch(self, generation_config):
# Sort the list using the custom key function
warpers = sorted(warpers, key=custom_sort_key)
if shared.args.verbose:
logger.info("WARPERS=")
pprint.PrettyPrinter(indent=4, sort_dicts=False).pprint([x.__class__.__name__ for x in warpers])
if normalize is not None:
warpers.append(normalize)
warpers.append(SpyLogitsWarper())
warpers = LogitsProcessorList(warpers)
if shared.args.verbose:
logger.info("WARPERS=")
pprint.PrettyPrinter(indent=4, sort_dicts=False).pprint([x.__class__.__name__ for x in warpers])
return warpers