File size: 2,525 Bytes
fd3464a
 
 
676b867
fd3464a
 
 
4ee1085
fd3464a
4ee1085
fd3464a
4ee1085
fd3464a
 
 
 
 
 
 
 
 
 
87c1f2e
 
fd3464a
ed8398a
a9cf382
ed8398a
fd3464a
ed8398a
1c4ab5c
fd3464a
87c1f2e
 
 
ed8398a
a9cf382
ed8398a
a9cf382
 
ed8398a
a9cf382
ed8398a
a9cf382
004f04c
a9cf382
36e3301
004f04c
 
 
38e8f00
 
004f04c
a9cf382
38e8f00
 
004f04c
 
a9cf382
004f04c
a9cf382
004f04c
 
 
 
 
a9cf382
3123032
 
 
 
ed8398a
a9cf382
ed8398a
a9cf382
 
 
ed8398a
a9cf382
ed8398a
 
 
a9cf382
ed8398a
 
 
004f04c
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<p align="center">
  <img src="./assets/large_icon.png" height="200" alt="icon" />
</p>

<p align="center">
  <em>📚 InkChatGPT - Chat with Documents</em>
</p>

<p align="center">
   <a href="https://inkchatgpt.streamlit.app/"><img src="https://static.streamlit.io/badges/streamlit_badge_black_white.svg"></a>
</p>

<p align="center">
<b><a href="https://x.com/vinhnx">Twitter</a>
<span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
<a href="https://github.com/vinhnx">GitHub</a></b>
</p>

# InkChatGPT

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

[![GitHub User's stars](https://img.shields.io/github/stars/vinhnx)](https://github.com/vinhnx)
[![HackerNews User Karma](https://img.shields.io/hackernews/user-karma/vinhnx)](https://news.ycombinator.com/user?id=vinhnx)
[![X (formerly Twitter) Follow](https://img.shields.io/twitter/follow/vinhnx)](https://x.com/vinhnx)

`InkChatGPT` is a `Streamlit` application that allows users to upload PDF documents and engage in a conversational Q&A with a language model (`LLM`) based on the content of those documents.

### Features

-   Upload any documents and start asking key information about it, currently supports: PDF, TXT, DOCX, EPUB
-   Limit 200MB per file
-   Conversational Q&A with LLM (powered by `OpenAI`'s `gpt-3.5-turbo` model)
-   `HuggingFace` embeddings to generate embeddings for the document chunks with `all-MiniLM-L6-v2` model.
-   `VectorDB` for document vector retrieval storage

## Prerequisites

-   Python 3.7 or later
-   OpenAI API key (set as an environment variable: `OPENAI_API_KEY`)

## Installation

1. Clone the repository:

```sh
git clone https://github.com/vinhnx/InkChatGPT.git
cd InkChatGPT
```

2. Setup Virtual Environment
We recommend setting up a virtual environment to isolate Python dependencies, ensuring project-specific packages without conflicting with system-wide installations.

```sh
python3 -m venv venv
source venv/bin/activate
```

3. Install the required dependencies:

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

## Usage

1. Set the `OPENAI_API_KEY` environment variable with your OpenAI API key:

```sh
export OPENAI_API_KEY=YOUR_API_KEY
```

2. Run the Streamlit app:

```sh
streamlit run app.py
```

3. Upload PDF documents and start chatting with the LLM!

## Contributing

Contributions are welcome! Please open an issue or submit a pull request if you have any improvements or bug fixes.

## License

This project is licensed under the [MIT License](LICENSE).