Skip to content

Commit

Permalink
fix: hardcoded stop tokens to patch Groq API's new 4 stop token limit…
Browse files Browse the repository at this point in the history
… for `/completions` (#1288)
  • Loading branch information
cpacker authored Apr 23, 2024
1 parent 7d328fe commit 4e67403
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions memgpt/local_llm/groq/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
}
)

Expand Down

0 comments on commit 4e67403

Please # to comment.