bahree / GenAIBook

"Generative AI in Action" book's code repository

Home Page:https://www.manning.com/books/generative-ai-in-action

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸ“š Book - Generative AI in Action

Welcome to the code repo associated with my book Generative AI in Action.

This repo has a few things that might be of interest:

  • Code from the different examples in the book.
  • List of research papers associated with different AI technology and techniques.
  • A Web application you can run locally brings many of these concepts together.
  • Detailed instructions for getting dependencies installed locally.
⚠️ Warning: OpenAI API Breaking Changes
OpenAI recently updated its API, and the code in the book is incompatible with the new API (v1.0). Unfortunately, this new version introduces breaking changes, which, while insignificant, are still breaking. I am working on updating the code and will have it available soon. If you are doing a fresh installation and want to follow the code in the chapters, it might be best to pin the installation to the older API version (v0.28).
If you are using pip, you can run the following command: pip install openai==0.28.0. Using conda, you can run the command: conda install -c conda-forge openai=0.28.0.

Core dependencies πŸ’½

Before we start installation instructions, as outlined in the book, we assume you have installed the following basic dependencies. For most developers and data scientists, these would already be in place, and there might not be any additional steps needed.

Note: If any of these are missing and need step-by-step instructions, see detailed dependency installation instructions.

  • IDE: Visual Studio Code or similar.
  • Python: Version 3.7.1 or later; we use version 3.11.3 for the book.
    • To check the Python version installed, run the following command: python --version
  • Package manager: Although technically a package manager is not needed, it would make things much easier to maintain. We use conda for the book, but you can use any you prefer.
  • Git: Given we are using GitHub, you need Git installed locally.

Installation instructions πŸ“š

The steps to get the environment up and running can be found in the installation instructions.

Where is the Code? πŸ“

The book's code is organized by chapters as expected and is in the folder called chapters. You will find a folder for each chapter following the convention of ch{chapter-number}.

You can find some utility functions and programs in the utils folder.

Web Application 🌎

In addition to the code from the chapter, a fully functional web application brings all the different constructs together in an easy-to-navigate web application that you can run locally. The code for this can be found in the webapp folder. 🐼

Note: ⚠️ The web application is meant only as a reference to run locally and not exposed to the internet. It does not have all the necessary proxies and controls one would build when exposing an application to the internet.

Papers

LLM and Generative AI are still quite new, and as a result, there is a fascinating list of very active research. You can find a pointer to many of these in the paper folder. These are organized by Chapter to help you navigate.

The reader is not expected to know these but as with most things, it is always good to go deeper and grok some of these concepts for a better and fuller understanding.

Contact

You can see my GitHub profile for different ways to get in touch. If there are any questions, or issues, please submit an Issue.

License

The work as part of this repo is shared under MIT License. In summary, this is a short and simple permissive license with conditions only requiring the preservation of copyright and license notices. Licensed, modified, and larger works may be distributed under different terms and without source code.

About

"Generative AI in Action" book's code repository

https://www.manning.com/books/generative-ai-in-action

License:MIT License


Languages

Language:Python 68.1%Language:Jupyter Notebook 10.4%Language:TypeScript 8.8%Language:Bicep 8.6%Language:CSS 1.9%Language:PowerShell 1.5%Language:COBOL 0.6%Language:HTML 0.2%Language:Dockerfile 0.1%