From the course: A Hands-On Introduction to Hugging Face for Developers

Unlock this course with a free trial

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

Deploying the conversational AI

Deploying the conversational AI

- [Instructor] So we'll now go over how we can deploy this model into a simple web app. Think of this as launching your product to the public, or in this case, giving it to the restaurant owner. Exciting, right? This time we'll start off by importing some Flask modules. In particular, we'll need Flask, render_template, request, and jsonify. Flask is obviously used to create the app, render_template helps us rendering the HTML template. In this case, this will be the index or HTML file within the Templates folder. Request captures incoming data from the user's requests such as messages sent by the user, and Jsonify converts Python dictionaries into JSON format, which can be sent as a response to the front end, which will be really useful for us. And then of course, we need to import Ollama. We go ahead and now initialize our Flask using the Flask method that we just imported. Now we can go ahead and add in the context from the previous lesson, which is just our prompt, and then we'll…

Contents