Coder Social home page Coder Social logo

aws-samples / pace-genai-demos Goto Github PK

View Code? Open in Web Editor NEW
35.0 1.0 15.0 64.04 MB

This repository features three demos that can be effortlessly integrated into your AWS environment. They serve as a practical guide to leveraging AWS services for crafting a sophisticated Large Language Model (LLM) Generative AI, geared towards creating a responsive Question and Answer Bot and localizing content generation.

Home Page: https://aws.amazon.com/blogs/machine-learning/harnessing-the-power-of-enterprise-data-with-generative-ai-insights-from-amazon-kendra-langchain-and-large-language-models/

License: MIT No Attribution

Dockerfile 0.91% Python 24.28% Shell 3.39% TypeScript 45.74% HTML 0.82% CSS 1.34% JavaScript 23.52%
amazon-bedrock aws bedrock cdk chatbot content-generation embeddings-model genai generative-ai hcls

pace-genai-demos's Introduction

Harnessing the power of enterprise data with generative AI: Insights from Amazon Kendra, LangChain, and large language models

This repository provides code samples for three Generative AI demos, licensed under MIT-0 license.

  1. Amazon Kendra with foundational LLM: Utilizes the deep search capabilities of Amazon Kendra combined with the expansive knowledge of Large Language Models. This integration provides precise and context-aware answers to complex queries by drawing from a diverse range of sources.

  2. Embeddings model with foundational LLM: Merges the power of embeddings—a technique to capture semantic meanings of words and phrases—with the vast knowledge base of LLMs. This synergy enables more accurate topic modeling, content recommendation, and semantic search capabilities.

Embeddings Foundational

  1. Foundation Models Pharma Ad Generator: A specialized application tailored for the pharmaceutical industry. Harnessing the generative capabilities of foundational models, this tool creates convincing and compliant pharmaceutical advertisements, ensuring content adheres to industry standards and regulations

Pharma Ad Generator

These demos can be seamlessly deployed in your AWS account, offering foundational insights and guidance on utilizing AWS services to create a state-of-the-art Large Language Model (LLM) Generative AI Question and Answer Bot and content generation.

You can deploy these demo's independent of each other. Please refer to the Readme files in each of the folders for deployment instructions.

Refer to the blog post for details on how these solutions work.

Authors

Troubleshoot

Unzipped size must be smaller than 262144000 bytes (Service: AWSLambdaInternal; Status Code: 400)

  1. Delete the Existing Lambda Layer Folder: Begin by removing the lambda_langchain_layer folder from your project. This action ensures that any corrupted or oversized files are cleared.
  2. Recreate the Layer: After deletion, recreate the lambda layer using the deploy.sh command. This process should generate a fresh, size-compliant layer with the necessary components.
  3. Clean Docker Resources: It's also crucial to ensure that no residual Docker images or containers are occupying unnecessary space. Clean all running Docker images and containers to free up space and avoid any potential conflicts.

Reporting Bugs/Feature Requests

When filing an issue, please check existing open, or recently closed, issues to make sure somebody else hasn't already reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:

  • A reproducible test case or series of steps
  • The version of our code being used
  • Any modifications you've made relevant to the bug
  • Anything unusual about your environment or deployment

License

This library is licensed under the MIT-0 License. See the LICENSE file.

pace-genai-demos's People

Contributors

amazon-auto avatar aravindkaws avatar jimburtoft avatar ztanruan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

pace-genai-demos's Issues

embeddingsbedrockLangchainLayer54390634 Lambda too big

I cloned the repo on 14/11/23, and from the tip of the main branch (commit hash: a01bb1b) tried to deploy the Embeddings-Foundational-LLM-ChatBot example.

But on the cloudformation deployment step in the guru-chatbot stack I ran into this error for the logical resource: embeddingsbedrockLangchainLayer54390634

Resource handler returned message: "Unzipped size must be smaller than 262144000 bytes (Service: AWSLambdaInternal; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: 5c2f3a4b-c0c9-48ba-ab7e-af70401b9f31; Proxy: null)" (RequestToken: 579e2a4b-d216-c234-1769-ff474b9ab1d3, HandlerErrorCode: GeneralServiceException)

Which I think means this Lambda layer is >250MB in size unzipped.

Checked and its 302MB unzipped. Lots of large python libs:

du -h . | sort -hr | head -n 10
302M .
81M ./botocore
78M ./botocore/data
70M ./faiss
36M ./numpy.libs
35M ./numpy
19M ./sqlalchemy
18M ./numpy/core
16M ./langchain
9.2M ./pydantic

How might this be resolved/worked-around?

[Feature Request] Add support for deployment via Cloud9 instances

Opening this issue as a feature request to add support for deploying this solution via AWS Cloud9.

Currently, when using Cloud9 to deploy the "Embeddings-Foundational-LLM-ChatBot" solution, we run into an error on the "lambda_langchain_layer" unzipped size being larger than lambda's 250Mb size constraint. As noted in the ReadMe for "Embeddings-Foundational-LLM-ChatBot", this solution may not function correctly when deployed via Cloud9 or similar cloud-based development environments.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.