Add auto_max_new_tokens parameter (#3419)
This commit is contained in:
parent
0d9932815c
commit
e931844fe2
12 changed files with 17 additions and 0 deletions
|
@ -21,6 +21,7 @@ def build_parameters(body, chat=False):
|
|||
|
||||
generate_params = {
|
||||
'max_new_tokens': int(body.get('max_new_tokens', body.get('max_length', 200))),
|
||||
'auto_max_new_tokens': bool(body.get('auto_max_new_tokens', False)),
|
||||
'do_sample': bool(body.get('do_sample', True)),
|
||||
'temperature': float(body.get('temperature', 0.5)),
|
||||
'top_p': float(body.get('top_p', 1)),
|
||||
|
|
|
@ -4,6 +4,7 @@ import copy
|
|||
# Data type is important, Ex. use 0.0 for a float 0
|
||||
default_req_params = {
|
||||
'max_new_tokens': 16, # 'Inf' for chat
|
||||
'auto_max_new_tokens': False,
|
||||
'temperature': 1.0,
|
||||
'top_p': 1.0,
|
||||
'top_k': 1, # choose 20 for chat in absence of another default
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue