fix: hardcoded stop tokens to patch Groq API's new 4 stop token limit for /completions (#1288)

This commit is contained in:
Charles Packer
2024-04-22 20:20:17 -07:00
committed by GitHub
parent 416ed3fad9
commit bdd3aa4457

View File

@@ -26,6 +26,26 @@ def get_groq_completion(endpoint: str, auth_type: str, auth_key: str, model: str
# "top_p",
# "stream",
# "stop",
# Groq only allows 4 stop tokens
"stop": [
"\nUSER",
"\nASSISTANT",
"\nFUNCTION",
# "\nFUNCTION RETURN",
# "<|im_start|>",
# "<|im_end|>",
# "<|im_sep|>",
# # airoboros specific
# "\n### ",
# # '\n' +
# # '</s>',
# # '<|',
# "\n#",
# # "\n\n\n",
# # prevent chaining function calls / multi json objects / run-on generations
# # NOTE: this requires the ability to patch the extra '}}' back into the prompt
" }\n}\n",
]
}
)