mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-25 17:29:22 +01:00
Handle empty sampler priority field, use default values
This commit is contained in:
parent
775902c1f2
commit
494cc3c5b0
@ -290,9 +290,9 @@ def generate_reply_HF(question, original_question, seed, state, stopping_strings
|
|||||||
if k in state:
|
if k in state:
|
||||||
generate_params[k] = state[k]
|
generate_params[k] = state[k]
|
||||||
|
|
||||||
if isinstance(state['sampler_priority'], list):
|
if isinstance(state['sampler_priority'], list) and len(state['sampler_priority']) > 0:
|
||||||
generate_params['sampler_priority'] = state['sampler_priority']
|
generate_params['sampler_priority'] = state['sampler_priority']
|
||||||
elif isinstance(state['sampler_priority'], str):
|
elif isinstance(state['sampler_priority'], str) and state['sampler_priority'].strip() != '':
|
||||||
generate_params['sampler_priority'] = [x.strip() for x in state['sampler_priority'].replace('\n', ',').split(',') if x.strip()]
|
generate_params['sampler_priority'] = [x.strip() for x in state['sampler_priority'].replace('\n', ',').split(',') if x.strip()]
|
||||||
|
|
||||||
if state['negative_prompt'] != '':
|
if state['negative_prompt'] != '':
|
||||||
|
Loading…
Reference in New Issue
Block a user