GithubHelp home page GithubHelp logo

chenxin1212 / amazon-bedrock-aistylist-lab Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aws-samples/amazon-bedrock-aistylist-lab

0.0 0.0 0.0 9.46 MB

License: MIT No Attribution

Python 0.16% Jupyter Notebook 99.84%

amazon-bedrock-aistylist-lab's Introduction

Alt text

Amazon Bedrock AI Stylist lab

Introduction

Welcome to the AI Stylist Lab!

This lab explores some of the most common usage patterns for Generative AI use cases. You will gain hands-on experience implementing these patterns with Amazon Bedrock.

Amazon Bedrock is a fully managed service that provides access to Foundation Models (FMs) from third-party providers and Amazon. With Amazon Bedrock, you can choose from a variety of models to find the one that’s best suited for your use case.

In this lab, you'll build your own AI Stylist application, a new shopping experience for customers where you will explore how Amazon Bedrock features come together to help the customer create an outfit for going back to the office. This lab is the next step of your Amazon Bedrock learning journey, after the AI Stylist demo. We will use techniques for generating text and images, chat experience, entity extraction, and retrieval-augmented generation (RAG). You will gain hands-on experience with implementing these patterns via Amazon Bedrock APIs and SDKs, as well as open-source software like LangChain and FAISS.

Lab objectives:

  • Extract product attributes from a customer prompt
  • Use RAG to embed a product catalog and order history in Amazon Titan Embeddings
  • Query the embeddings to generate 5 style looks from the customer prompt
  • Generate images for the 5 looks.
  • Add a chatbot to answer questions about customer reviews about the product
  • Generate a summary for the customers reviews about the product
  • Integrate a DIY agent to associate weather data and recommend accessories

Getting started

Choose a notebook environment

This workshop is presented as a series of Python notebooks, which you can run from the environment of your choice:

Running the workshop

Enable AWS IAM permissions for Bedrock

The AWS identity you assume from your notebook environment (which is the Studio/notebook Execution Role from SageMaker, or could be a role or IAM User for self-managed notebooks), must have sufficient AWS IAM permissions to call the Amazon Bedrock service.

To grant Bedrock access to your identity, you can:

  • Open the AWS IAM Console
  • Find your Role (if using SageMaker or otherwise assuming an IAM Role), or else User
  • Select Add Permissions > Create Inline Policy to attach new inline permissions, open the JSON editor and paste in the below example policy:
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "BedrockFullAccess",
            "Effect": "Allow",
            "Action": ["bedrock:*"],
            "Resource": "*"
        }
    ]
}

⚠️ Note: With Amazon SageMaker, your notebook execution role will typically be separate from the user or role that you log in to the AWS Console with. If you'd like to explore the AWS Console for Amazon Bedrock, you'll need to grant permissions to your Console user/role too.

For more information on the fine-grained action and resource permissions in Bedrock, check out the Bedrock Developer Guide.

Clone and use the notebooks

ℹ️ Note: In SageMaker Studio, you can open a "System Terminal" to run these commands by clicking File > New > Terminal

Once your notebook environment is set up, clone this workshop repository into it.

sudo yum install -y unzip
git clone https://github.com/aws-samples/amazon-bedrock-aistylist-lab.git
cd amazon-bedrock-aistylist-lab

You're now ready to explore the lab notebooks!

amazon-bedrock-aistylist-lab's People

Contributors

rsgrewal-aws avatar amazon-auto avatar

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.