You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I searched the LangChain documentation with the integrated search.
I used the GitHub search to find a similar question and didn't find it.
I am sure that this is a bug in LangChain rather than my code.
The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).
Example Code
fromlangchain.chainsimportLLMChainfromlangchain.promptsimportHumanMessagePromptTemplatefromlangchain.prompts.chatimportChatPromptTemplatefromlangchain_community.chat_modelsimportBedrockChatimportlangchainlangchain.debug=Truedefget_llama3_bedrock(
model_id="meta.llama3-70b-instruct-v1:0",
max_gen_len=2048,
top_p=0.0,
temperature=0.0,
):
model_kwargs= {
"top_p": top_p,
"max_gen_len": max_gen_len,
"temperature": temperature,
}
returnBedrockChat(model_id=model_id, model_kwargs=model_kwargs)
prompt_poem="""This is a poem by William Blake============Never seek to tell thy loveLove that never told can be For the gentle wind does moveSilently invisiblyI told my love I told my love I told her all my heart Trembling cold in ghastly fearsAh she doth departSoon as she was gone from meA traveller came bySilently invisibly O was no deny ============What did the lady do?"""langchain_prompt=ChatPromptTemplate.from_messages([
HumanMessagePromptTemplate.from_template(prompt_poem)
]
)
print("Response 1:", LLMChain(llm=get_llama3_bedrock(), prompt=langchain_prompt).run(dict()))
#Responds: ''prompt_simple_question="""What is the capital of China?"""langchain_prompt=ChatPromptTemplate.from_messages([
HumanMessagePromptTemplate.from_template(prompt_simple_question)
]
)
print("Response 2:", LLMChain(llm=get_llama3_bedrock(), prompt=langchain_prompt).run(dict()))
#Responds: 'Beijing.'
Error Message and Stack Trace (if applicable)
No response
Description
I am trying to use BedrockChat to call Llama3 on our AWS account.
Here is the issue:
I try to pass a long-ish (multiline) prompt and it returns an empty string.
Passing the same long-ish prompt directly on the AWS Console generate the expected answer.
- Passing a single line questions like `What is the capital of China?` return the expected answer `Beijing.`
The text was updated successfully, but these errors were encountered:
dosubotbot
added
the
🤖:bug
Related to a bug, vulnerability, unexpected error with an existing feature
label
Apr 29, 2024
fedor-intercom
changed the title
Querying Llama3 70b using LangchainChatBedrock returns empty response if prompt is long
Querying Llama3 70b using BedrockChat returns empty response if prompt is long
Apr 30, 2024
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
No response
Description
I am trying to use
BedrockChat
to call Llama3 on our AWS account.Here is the issue:
System Info
platform: mac
python version: 3.11.7
langchain==0.1.16
langchain-community==0.0.34
langchain-core==0.1.46
langchain-text-splitters==0.0.1
The text was updated successfully, but these errors were encountered: