mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-21 23:57:58 +01:00
Sampler priority: better logging, always save to presets
This commit is contained in:
parent
acfbe6b3b3
commit
775902c1f2
@ -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)
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user