Skip to content

Commit

Permalink
update README.MD
Browse files Browse the repository at this point in the history
  • Loading branch information
omar-sol committed Feb 21, 2024
1 parent 5bfbf4e commit 872ce15
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 6 deletions.
49 changes: 47 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,55 @@
---
title: AI Tutor Chatbot
emoji: 🌍
emoji: 🧑🏻‍🏫
colorFrom: gray
colorTo: pink
sdk: gradio
sdk_version: 4.19.1
app_file: scripts/gradio-ui.py
pinned: false
---
---
---
This project creates a helpful and accurate AI Tutor chatbot, leveraging GPT-3.5-Turbo and a RAG system. We design it to address student questions about AI with precision and clarity.

### Installation

1. **Create a new Python environment:**

```bash
python -m venv .venv
```

This command creates a virtual environment named `.venv`.

2. **Activate the environment:**

For macOS and Linux:

```bash
source .venv/bin/activate
```

3. **Install the dependencies:**

```bash
pip install -r requirements.txt
```

### Usage

1. **Set environment variables:**

Before running the application, you need to set up your OpenAI API key and MongoDB URI as environment variables:

```bash
export OPENAI_API_KEY=your_openai_api_key_here
export MONGODB_URI=your_mongodb_uri_here
```

2. **Run the application:**

```bash
python scripts/gradio-ui.py
```

This command starts the Gradio interface for the AI Tutor chatbot.
7 changes: 3 additions & 4 deletions scripts/gradio-ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
vector_store = ChromaVectorStore(chroma_collection=chroma_collection)
index = VectorStoreIndex.from_vector_store(vector_store=vector_store)

# Initialize query engine
# Initialize OpenAI models
llm = OpenAI(temperature=0, model="gpt-3.5-turbo-0125", max_tokens=None)
embeds = OpenAIEmbedding(model="text-embedding-3-large", mode="text_search")

Expand Down Expand Up @@ -284,9 +284,8 @@ def get_answer(history, sources: Optional[list[str]] = None):
# )

chatbot.like(log_likes, completion)

submit_email.click(log_emails, email, email)
email.submit(log_emails, email, email)

demo.queue()
demo.launch(debug=True, share=False)
demo.queue(default_concurrency_limit=CONCURRENCY_COUNT)
demo.launch(debug=False, share=False)

0 comments on commit 872ce15

Please sign in to comment.