mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
add top_k + stop to litellm utils
This commit is contained in:
parent
c0e464a2f6
commit
b75b4bcf21
2 changed files with 14 additions and 5 deletions
|
@ -875,10 +875,14 @@ def get_optional_params( # use the openai defaults
|
|||
optional_params["temperature"] = temperature
|
||||
if top_p != 1:
|
||||
optional_params["top_p"] = top_p
|
||||
if top_k != 40:
|
||||
optional_params["top_k"] = top_k
|
||||
if max_tokens != float("inf"):
|
||||
optional_params["max_tokens"] = max_tokens
|
||||
if frequency_penalty != 0:
|
||||
optional_params["frequency_penalty"] = frequency_penalty
|
||||
optional_params["frequency_penalty"] = frequency_penalty # should be repetition penalty
|
||||
if stop != None:
|
||||
optional_params["stop"] = stop #TG AI expects a list, example ["\n\n\n\n","<|endoftext|>"]
|
||||
elif (
|
||||
model == "chat-bison"
|
||||
): # chat-bison has diff args from chat-bison@001 ty Google
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue