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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ChatBedrock model doesn't work with llama 2 models when using the stop sequence in non-streaming mode #62

Open
haoguohua opened this issue May 30, 2024 · 0 comments · May be fixed by #63

Comments

@haoguohua
Copy link

When using ChatBedrock with llama 2 models and generating texts in non-streaming mode, setting stop sequence will cause malformed input request error.

e.g. running the following code

model_id = "meta.llama2-70b-chat-v1"
model_kwargs = {
    "temperature": 0,
    "max_gen_len": 2048,
}

llm = BedrockChat(
    model_id=model_id,
    model_kwargs=model_kwargs
)

llm.invoke("show me the weather in sf", stop=["Humidity"])

will result in the following error message

ValueError: Error raised by bedrock service: An error occurred (ValidationException) when calling the InvokeModel operation: Malformed input request: extraneous key [stop_sequences] is not permitted, please reformat your input and try again.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant