Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gateway anthropic small fix for "n" parameter #10576

Merged
merged 2 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion mlflow/gateway/providers/anthropic.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def completions_to_model(cls, payload, config):
detail="Setting the 'stream' parameter to 'true' is not supported with the MLflow "
"Gateway.",
)
n = payload.get("n", 1)
n = payload.pop("n", 1)
if n != 1:
raise HTTPException(
status_code=422,
Expand Down
2 changes: 0 additions & 2 deletions tests/gateway/providers/test_anthropic.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ async def test_completions():
json={
"model": "claude-instant-1",
"temperature": 0.5,
"n": 1,
"max_tokens_to_sample": 200,
"prompt": "\n\nHuman: How does a car work?\n\nAssistant:",
"stop_sequences": ["foobazbardiddly"],
Expand All @@ -109,7 +108,6 @@ async def test_completions_with_default_max_tokens():
json={
"model": "claude-instant-1",
"temperature": 0.0,
"n": 1,
"max_tokens_to_sample": 200000,
"prompt": "\n\nHuman: How does a car work?\n\nAssistant:",
},
Expand Down