课程: Advanced LLMs with Retrieval Augmented Generation (RAG): Practical Projects for AI Applications
免费学习该课程!
今天就开通帐号,24,700 门业界名师课程任您挑!
驻文化部纪检组与文化部党组联合发文就2017年贯彻...
课程: Advanced LLMs with Retrieval Augmented Generation (RAG): Practical Projects for AI Applications
Hands-on lab: Embedding tokenization
- To get a better understanding of the embedding concepts we just discussed, let's review the embedding model notebook in a repository. We will check the OpenAI embedding model and then we'll take two open-source models. For the first one, we'll explore the difference between the input and the output embedding, then we will try to take some kind of an improving coder that can learn from the context and that is very useful if you want to improve our retrieval part. We'll use Rich library to make the input easier to understand, and we'll ignore the warnings. So let's start with the OpenAI embedding. We'll take a sentence, I have no interest in politics, and we call the OpenAI encoder. Note that here, we don't have the model here. It's we have a client, the client is calling the the endpoint of OpenAI, and we'll get a long list of numbers, that this is the embedding vector of our sentence. Let's dive to the end, and we can see that it's using one of their models. The text embedding, the…