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.
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 . |
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 version3.11.3
for the book.- To check the Python version installed, run the following command:
python --version
- To check the Python version installed, run the following command:
- 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.
The steps to get the environment up and running can be found in the installation instructions.
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.
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:
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.
You can see my GitHub profile for different ways to get in touch. If there are any questions, or issues, please submit an Issue.
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.