Update README
Browse files
README.md
CHANGED
|
@@ -1,59 +1,39 @@
|
|
| 1 |
-
#
|
| 2 |
|
| 3 |
## Overview
|
| 4 |
|
| 5 |
-
|
| 6 |
|
| 7 |
-
##
|
| 8 |
-
|
| 9 |
-
- AI, ML, and DL question-answering capabilities.
|
| 10 |
-
- Integration with ChromaDB for persistent storage.
|
| 11 |
-
- Utilizes OpenAI's models for generating responses.
|
| 12 |
-
- Gradio interface for easy interaction.
|
| 13 |
-
- Memory management for maintaining conversation context.
|
| 14 |
-
|
| 15 |
-
## Requirements
|
| 16 |
|
| 17 |
-
|
| 18 |
|
| 19 |
```bash
|
| 20 |
-
|
|
|
|
| 21 |
```
|
| 22 |
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
1. **Clone the Repository**
|
| 26 |
-
|
| 27 |
-
```bash
|
| 28 |
-
git clone https://huggingface.co/yourusername/towards-ai
|
| 29 |
-
cd towards-ai
|
| 30 |
-
```
|
| 31 |
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
```bash
|
| 36 |
-
OPENAI_API_KEY=
|
| 37 |
-
LOGFIRE_TOKEN=
|
| 38 |
-
COHERE_API_KEY=
|
| 39 |
-
MONGODB_URI=
|
| 40 |
-
DB_NAME=ai_tutor_knowledge
|
| 41 |
-
```
|
| 42 |
-
3. **Download the Vector Database**
|
| 43 |
-
|
| 44 |
-
The bot requires a pre-trained vector database. If it doesn't exist locally, it will automatically download it from Hugging Face Hub when you run the code.
|
| 45 |
|
| 46 |
-
|
| 47 |
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
|
| 53 |
-
|
| 54 |
|
| 55 |
-
|
|
|
|
|
|
|
| 56 |
|
| 57 |
-
|
| 58 |
|
| 59 |
-
|
|
|
|
|
|
|
|
|
| 1 |
+
# Building and Deploying a Gradio UI on Hugging Face Spaces
|
| 2 |
|
| 3 |
## Overview
|
| 4 |
|
| 5 |
+
This repository contains the code of the "Building and Deploying a Gradio UI on Hugging Face Spaces" lesson of the "From Beginner to Advanced LLM Developer" course.
|
| 6 |
|
| 7 |
+
## Setup
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
+
1. Clone the repository.
|
| 10 |
|
| 11 |
```bash
|
| 12 |
+
git clone git@github.com:towardsai/ai-tutor-gradio-lesson.git
|
| 13 |
+
cd ai-tutor-gradio-lesson
|
| 14 |
```
|
| 15 |
|
| 16 |
+
2. Create a `.env` file and add there your OpenAI API key. Its content should be something like:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
+
```bash
|
| 19 |
+
OPENAI_API_KEY="sk-..."
|
| 20 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
+
3. Create a local virtual environment, for example using the `venv` module. Then, activate it.
|
| 23 |
|
| 24 |
+
```bash
|
| 25 |
+
python -m venv venv
|
| 26 |
+
source venv/bin/activate
|
| 27 |
+
```
|
| 28 |
|
| 29 |
+
4. Install the dependencies.
|
| 30 |
|
| 31 |
+
```bash
|
| 32 |
+
pip install -r requirements.txt
|
| 33 |
+
```
|
| 34 |
|
| 35 |
+
5. Launch the Gradio app.
|
| 36 |
|
| 37 |
+
```bash
|
| 38 |
+
python app.py
|
| 39 |
+
```
|