mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2026-04-05 06:35:15 +00:00
Add custom sampler order support (#5443)
This commit is contained in:
parent
7301c7618f
commit
8c35fefb3b
9 changed files with 205 additions and 113 deletions
|
|
@ -291,6 +291,11 @@ def generate_reply_HF(question, original_question, seed, state, stopping_strings
|
|||
if k in state:
|
||||
generate_params[k] = state[k]
|
||||
|
||||
if isinstance(state['sampler_priority'], list):
|
||||
generate_params['sampler_priority'] = state['sampler_priority']
|
||||
elif isinstance(state['sampler_priority'], str):
|
||||
generate_params['sampler_priority'] = [x.strip() for x in state['sampler_priority'].replace('\n', ',').split(',') if x.strip()]
|
||||
|
||||
if state['negative_prompt'] != '':
|
||||
generate_params['negative_prompt_ids'] = encode(state['negative_prompt'])
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue