aws-samples / amazon-bedrock-workshop

This is a workshop designed for Amazon Bedrock a foundational model service.
https://catalog.us-east-1.prod.workshops.aws/amazon-bedrock/en-US
MIT No Attribution
1.45k stars 625 forks source link

Error running /amazon-bedrock-workshop/04_Chatbot/00_Chatbot_Claude.ipynb #57

Closed vasanthbaburaju closed 1 year ago

vasanthbaburaju commented 1 year ago

Hi Team, When running Genai-GA-Demo/amazon-bedrock-workshop/04_Chatbot/00_Chatbot_Claude.ipynb, we are getting the below error

ValueError: Error: Prompt must alternate between '

Human:' and '

Assistant:'.

when running cell 8 print_ww(conversation.predict(input="Cool. Will that work with tomatoes?"))

This was running fine on preview & getting this error only for the past 2 days

vasanthbaburaju commented 1 year ago

The formatted input prompt based on the FM chose resolved the above issue.(sample below for anthropic.claude-v2)

    input_formatted_prompt = """
    Human: 

Human:" {0}"

Assistant: 
    """.format(input_text)