File size: 1,660 Bytes
15ad3d7
 
 
 
 
 
 
 
 
 
 
ca27c3a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
---
title: Custom Chatgpt
emoji: 💩
colorFrom: gray
colorTo: pink
sdk: gradio
sdk_version: 3.24.1
app_file: app.py
pinned: false
---

# Custom-trained AI Chatbot

This repository contains a custom-trained AI chatbot that uses OpenAI's GPT-3.5 Turbo model to provide responses based on a user's input. The chatbot utilizes an index of documents to generate relevant and informative responses.

## Prerequisites

Before you begin, ensure you have the following installed on your machine:

-   Python 3.6 or higher
-   [pip](https://pip.pypa.io/en/stable/installation/)

## Installation

1. Clone the repository:  
   `git clone https://github.com/yourusername/your-repo-name.git`  
   `cd your-repo-name`

2. Install the required packages:
   `pip install -r requirements.txt`

3. Create a `.env` file in the project's root directory and add your OpenAI API key:
   `OPENAI_API_KEY=your_openai_api_key`

## ChatGPT model name

`model_name="gpt-3.5-turbo"`

_Most capable GPT-3.5 model and optimized for chat at 1/10th the cost of text-davinci-003._

or

`model_name="text-davinci-003"`

## Usage

1. Place your documents in the `docs` directory.

2. Run the `app.py` script:

    `python app.py`

3. Open the Gradio interface in your web browser, enter your text in the input textbox, and click "Submit" to get a response from the chatbot.

## Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

## Setup at Hugging Face

Check out the configuration reference at  
https://huggingface.co/docs/hub/spaces-config-reference

## License

[MIT](https://choosealicense.com/licenses/mit/)