mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2025-06-07 22:25:54 -04:00
llama.cpp: Add top_n_sigma, fix typical_p in sampler priority
This commit is contained in:
parent
cbef35054c
commit
d1c0154d66
2 changed files with 5 additions and 2 deletions
|
@ -66,6 +66,7 @@ class LlamaServer:
|
||||||
"top_k": state["top_k"],
|
"top_k": state["top_k"],
|
||||||
"top_p": state["top_p"],
|
"top_p": state["top_p"],
|
||||||
"min_p": state["min_p"],
|
"min_p": state["min_p"],
|
||||||
|
"top_n_sigma": state["top_n_sigma"] if state["top_n_sigma"] > 0 else -1,
|
||||||
"tfs_z": state["tfs"],
|
"tfs_z": state["tfs"],
|
||||||
"typical_p": state["typical_p"],
|
"typical_p": state["typical_p"],
|
||||||
"repeat_penalty": state["repetition_penalty"],
|
"repeat_penalty": state["repetition_penalty"],
|
||||||
|
@ -102,8 +103,10 @@ class LlamaServer:
|
||||||
|
|
||||||
penalty_found = False
|
penalty_found = False
|
||||||
for s in samplers:
|
for s in samplers:
|
||||||
if s.strip() in ["dry", "top_k", "typ_p", "top_p", "min_p", "xtc", "temperature"]:
|
if s.strip() in ["dry", "top_k", "top_p", "top_n_sigma", "min_p", "temperature", "xtc"]:
|
||||||
filtered_samplers.append(s.strip())
|
filtered_samplers.append(s.strip())
|
||||||
|
elif s.strip() == "typical_p":
|
||||||
|
filtered_samplers.append("typ_p")
|
||||||
elif not penalty_found and s.strip() == "repetition_penalty":
|
elif not penalty_found and s.strip() == "repetition_penalty":
|
||||||
filtered_samplers.append("penalties")
|
filtered_samplers.append("penalties")
|
||||||
penalty_found = True
|
penalty_found = True
|
||||||
|
|
|
@ -52,7 +52,7 @@ def default_preset():
|
||||||
|
|
||||||
if shared.args.portable:
|
if shared.args.portable:
|
||||||
samplers = result['sampler_priority'].split('\n')
|
samplers = result['sampler_priority'].split('\n')
|
||||||
samplers = [sampler for sampler in samplers if sampler in ["dry", "top_k", "typ_p", "top_p", "min_p", "xtc", "temperature", "repetition_penalty"]]
|
samplers = [sampler for sampler in samplers if sampler in ["dry", "top_k", "top_p", "top_n_sigma", "min_p", "temperature", "xtc", "typical_p", "repetition_penalty"]]
|
||||||
result['sampler_priority'] = '\n'.join(samplers)
|
result['sampler_priority'] = '\n'.join(samplers)
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
Loading…
Add table
Reference in a new issue