- Newest
- Most votes
- Most comments
I found the problem. The problem stems from langchain
Hi Ihsan @Ihsan, would you mind kindly sharing more information on the cause and solution of this problem? Now I'm stuck in the same issue. Thank you.
Do not use langchain. It changes prompt internally @Yuz
Thx @Ihsan. Do you mean the Langchain PromptTemplatet re-write the prompt and cause the problem, as llama requires a different prompt format? Can you share how it changes it if possible? Sorry a lot of questions.
It seems like you're experiencing intermittent issues with receiving empty responses from the Llama 3 model in Bedrock, despite providing correct input prompts. Here are a few possible reasons and troubleshooting steps to consider:
-
Prompt Format: Ensure that the prompt format follows the guidelines provided for Llama 3 models. Based on the example provided in the AWS blog post you mentioned, the prompt should start with
<|begin_of_text|><|start_header_id|>user<|end_header_id|>\n\n
followed by your actual prompt content, and end with<|start_header_id|>assistant<|end_header_id|>\n\n
. -
Token Count: Check the token count of your input prompt. In your example, the token count is 1056. Make sure this count accurately reflects the length of your input prompt.
-
Temperature Setting: Experiment with different temperature settings to see if it affects the model's behavior. Higher temperatures can result in more creative but potentially less coherent responses, while lower temperatures can produce more conservative and predictable outputs.
-
Retry Logic: Implement retry logic in your application to handle cases where you receive empty responses. If you consistently receive empty responses for the same input prompt, retrying the request may yield a valid response.
-
Check API Limits: Verify that you're not hitting any API rate limits or quotas that could cause intermittent issues with model responses. AWS provides documentation on API usage limits for Bedrock services that you can review.
-
Contact Support: If the issue persists and you're unable to determine the cause, consider reaching out to AWS support for assistance. They can investigate further and provide guidance based on the specifics of your situation.
Regarding your suspicion about the [INST]
tokens, if these tokens are automatically added by the API and are not part of the expected input format for Llama 3 models, they could potentially cause issues. You may want to confirm with AWS support or consult the documentation to ensure that your input prompt format is correct.
Overall, troubleshooting intermittent issues with model responses can be challenging, but by systematically checking and adjusting various factors, you may be able to identify the root cause and resolve the problem.
Relevant content
- asked 2 months ago
- asked 19 days ago
- AWS OFFICIALUpdated 14 days ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated a month ago
- AWS OFFICIALUpdated a month ago
sounds a bit like intermittent issues. check out the answer i submitted