From the course: Hands-On AI: Build a RAG Model from Scratch with Open Source

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Putting it all together to generate a working RAG model

Putting it all together to generate a working RAG model

From the course: Hands-On AI: Build a RAG Model from Scratch with Open Source

Putting it all together to generate a working RAG model

- [Instructor] We finally made it to homestretch. We're now gonna combine everything we have and create a fully functional RAG model. Let's recap what we need to do. First, we'll take a query that a user inputs. Then we'll calculate the vector embedding associated with that query and process the context relevant to the query using the functions we've custom designed for this purpose. And then we'll pass all that information into a well-crafted prompt and pass that prompt to the large language model. Let's go ahead and create a file called run_rag.py, because that is what it will do. And to save time, let's hardcode a default query for testing purposes. So our query is simply gonna be, "Is the Dominican Republic a member of the United Nations?" And let's also pull in some imports. These are all imports that we're very familiar with by now. And in case this query is not to be used and we wanna pass a query in, let's go…

Contents