OpenAI GPT for Python Developers The Art and Science of Building AI-Powered Apps with GPT-4, Whisper, Weaviate, and Beyond

“OpenAI GPT for Python Developers” is meticulously crafted to provide Python developers with a deep dive into the mechanics and applications of GPT technology, beginning with a captivating narrative on the evolution of OpenAI and the fundamental workings of GPT models. As readers progress, they will...

Descripción completa

Detalles Bibliográficos
Otros Autores: El Amri, Aymen, author (author)
Formato: Libro electrónico
Idioma:Inglés
Publicado: Paris, France : FAUN [2024]
Edición:First edition
Materias:
Ver en Biblioteca Universitat Ramon Llull:https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009820528706719
Tabla de Contenidos:
  • Intro
  • Preface
  • About the Author
  • The Story of OpenAI and ChatGPT
  • About This Guide
  • The Companion Toolkit
  • Stay Connected
  • How Does GPT Work?
  • Setting Up the Development Environment
  • Notes
  • Installing Python, pip, and a Virtual Development Environment
  • Obtain Your OpenAI API Keys
  • Install the Official Python Bindings
  • Test our API Keys
  • Understanding the Available Models and Which One to Use
  • OpenAI Available Models and Important Considerations
  • Which Model to Use?
  • OpenAI Model Series
  • GPT-4 Series
  • GPT-3.5 Series
  • InstructGPT-3 Series
  • Base GPT-3 Series
  • Codex Series
  • Content Filter
  • DALL-E Series
  • TTS Series
  • Whisper Model
  • Embedding Model
  • OpenAI Models and Pricing
  • What's Next?
  • Using GPT Chat Completions
  • An Introductory Example
  • System, User, and Assistant Roles
  • The System Role
  • The User Role
  • The Assistant Role
  • Few-shot Learning with Chat Completions
  • Formatting the Output
  • Controlling the Output's Token Count
  • Controlling When the Completion Output Stops
  • Temperature and Hallucination
  • Sampling with Top_p
  • Temperature vs Top_p: What's the Difference? Which One Should I Use?
  • Streaming the API Response
  • Controlling Repetitiveness: Frequency and Presence Penalties
  • Frequency vs. Presence Penalty
  • Controlling the Number of Results from the API
  • Conclusion
  • Advanced Examples and Prompt Engineering
  • What is Prompt Engineering?
  • Few Shot Learning: A Key Prompt Engineering Technique
  • Overgeneration and Selection
  • General Knowledge Prompting (GKP): Generating a Rap Song
  • Context Stuffing: Is Apple a Fruit or a Company?
  • Dynamic Max Tokens
  • Creating an Interactive CLI-Based Assistant
  • What's Next?
  • Embedding
  • What is an Embedding?
  • Use Cases: From Modern Search Engines to Self-Driving Cars.
  • Tesla: How Embeddings Are Used in Self-Driving Cars
  • Kalendar AI: The Power of Embeddings in Sales Outreach
  • Notion: Enhanced Search Capabilities
  • DALL·E 2: Text-to-Image Conversion
  • Understanding Text Embedding
  • Embeddings for Multiple Inputs
  • Use case: Semantic Search
  • Cosine Similarity: A Deeper Look
  • Semantic Search and OpenAI's Text Embeddings
  • Behind the Scenes: How Embeddings Work
  • Advanced Embedding Examples
  • Predicting Your Preferred Coffee
  • Creating a "Fuzzier" Search
  • Predicting News Category: Zero-Shot Classification with Embeddings
  • Evaluating the Accuracy of a Zero-Shot Classifier
  • Precision in Zero-Shot Classifier Applications: Examples
  • Fine-Tuning and Best Practices
  • Few-Shot Learning
  • Enhancing Few-Shot Learning
  • Practical Application of Fine-Tuning
  • Fine-Tuning Best Practices
  • Choosing the Model
  • Validating the Dataset
  • Token Limit
  • Dataset Size
  • Testing and Improving Training (Hyperparameters)
  • Epochs
  • Learning Rate Multiplier
  • Batch Size
  • Consider Estimated Costs
  • Dataset Quality
  • Combining Fine-Tuning with Other Techniques
  • Experiment and Learn
  • Use a Validation Set
  • Test the Model
  • Analyze the Results
  • Advanced Fine-Tuning: Mental Health Coach
  • Dataset Used in the Example
  • Preparing the Data
  • Using the Model in Real-World Applications and Challenges
  • Context &amp
  • Memory: Making AI More Real
  • The Problem: No Memory
  • No Context = Chaos of Randomness and Confusion
  • History = Context
  • The Problem with Carrying Over History
  • Last In First Out (LIFO) Memory
  • The Problem with Last In, First Out Memory
  • Selective Context
  • Using a Vector Database with OpenAI
  • Introduction
  • What is a Vector Database?
  • Example 1: Using Weaviate to Make Our Model More Context-Aware
  • Example 2: Using Weaviate and OpenAI in Semantic Search.
  • Example 3: Using Weaviate and OpenAI for Generative Search
  • Speech Recognition and Translation Using Whisper
  • What is Whisper?
  • How to Get Started?
  • Transcribe and Translate
  • Using Whisper SDK in Python
  • Using OpenAI Speech to Text API
  • Transcription API
  • Translation API
  • Improving Whisper Transcription
  • Cleaning the Audio
  • Using the Prompt Parameter
  • Post-Processing the Transcription
  • Text-to-Speech with OpenAI TTS Models
  • Autonomous AI-to-AI Discussion Using OpenAI, Weaviate, and AI Avatars
  • Generating the Audio Files
  • Using AI Avatar Models
  • What's Next?
  • Afterword.