aws-samples / serverless-exam-generator-from-your-lecture-amazon-bedrock

MIT No Attribution
9 stars 2 forks source link

The exam has not been generated #4

Open gutomo opened 5 months ago

gutomo commented 5 months ago

Describe the bug The exam has not been generated.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Exam Generation Front-End'
  2. Input the necessary parameters and upload the PDF file
  3. Check the S3 bucket under the prefix 'exams' to make sure the PDF file has been uploaded successfully.
  4. Wait a few second
  5. The exam has not been generated in the S3 bucket under the prefix 'questions_bank'.
  6. Check the CloudWatch Log groups /aws/lambda/ExamGenFn-exam-gen [ERROR] Runtime.ImportModuleError: Unable to import module 'main': Module langchain_community.llms not found. Please install langchain-community to access this module. You can install it using pip install -U langchain-community Traceback (most recent call last):

Expected behavior The exam has been generated in the S3 bucket under the prefix 'questions_bank'.

gutomo commented 5 months ago

How to fix

  1. Update lambda layer requirements.txt boto3==1.34.117 # update to latest boto3 version ... langchain_community # add langchain_community ...
  2. update ExamGenFn/utils/helper_bedrock.py replace from langchain.llms.bedrock import Bedrock with from langchain_community.llms import Bedrock
gutomo commented 5 months ago

https://python.langchain.com/v0.1/docs/integrations/llms/bedrock/