Автор: James Phoenix, Mike Taylor
Издательство: O’Reilly Media, Inc.
Год: 2024
Страниц: 423
Язык: английский
Формат: True PDF, True EPUB (Retail Copy)
Размер: 39.8 MB, 33.3 MB
Large language models (LLMs) and diffusion models such as ChatGPT and Stable Diffusion have unprecedented potential. Because they have been trained on all the public text and images on the internet, they can make useful contributions to a wide variety of tasks. And with the barrier to entry greatly reduced today, practically any developer can harness LLMs and diffusion models to tackle problems previously unsuitable for automation.
With this book, you'll gain a solid foundation in generative AI, including how to apply these models in practice. When first integrating LLMs and diffusion models into their workflows, most developers struggle to coax reliable enough results from them to use in automated systems. Authors James Phoenix and Mike Taylor show you how a set of principles called prompt engineering can enable you to work effectively with AI.
All of the code in this book is in Python and was designed to be run in a Jupyter Notebook or Google Colab notebook. The concepts taught in the book are transferable to jаvascript or any other coding language if preferred, though the primary focus of this book is on prompting techniques rather than traditional coding skills. The code can all be found on GitHub, and we will link to the relevant notebooks throughout. It’s highly recommended that you utilize the GitHub repository and run the provided examples while reading the book.
For non-notebook examples, you can run the script with the format python content/chapter_x/script.py in your terminal, where x is the chapter number and script.py is the name of the script. In some instances, API keys need to be set as environment variables, and we will make that clear. The packages used update frequently, so install our requirements.txt in a virtual environment before running code examples.
We provide examples using open source libraries wherever possible, though we do include commercial vendors where appropriate—for example, Chapter 5 on vector databases demonstrates both FAISS (an open source library) and Pinecone (a paid vendor). The examples demonstrated in the book should be easily modifiable for alternative models and vendors, and the skills taught are transferable. Chapter 4 on advanced text generation is focused on the LLM framework LangChain, and Chapter 9 on advanced image generation is built on AUTOMATIC1111’s open source Stable Diffusion Web UI.
Learn how to empower AI to work for you. This book explains:
The structure of the interaction chain of your program's AI model and the fine-grained steps in between
How AI model requests arise from transforming the application problem into a document completion problem in the model training domain
The influence of LLM and diffusion model architecture—and how to best interact with it
How these principles apply in practice in the domains of natural language processing, text and image generation, and code
Скачать Prompt Engineering for Generative AI: Future-Proof Inputs for Reliable AI Outputs (Final Release)
True PDF:
True ePub: