Spaces:
Sleeping
Sleeping
Update README
Browse files
README.md
CHANGED
@@ -4,115 +4,60 @@
|
|
4 |
|
5 |
# π [InkChatGPT](https://inkchatgpt.streamlit.app) [](https://inkchatgpt.streamlit.app)
|
6 |
|
7 |
-
InkChatGPT is a
|
8 |
-
|
9 |
-
The app allows users to upload documents (PDFs or text files), and then ask questions related to the content of those documents. The RAG model retrieves relevant passages from the documents and generates an answer based on the retrieved context.
|
10 |
-
|
11 |
-
π Try it here: [InkChatGPT](https://inkchatgpt.streamlit.app/)
|
12 |
-
|
13 |
-
---
|
14 |
-
|
15 |
-
Running RAG to ask question about certain information inside the Document.
|
16 |
-
|
17 |
-
> [!NOTE]
|
18 |
-
> For this demo, I use asked the model about the [How to Build Your Career in AI](https://info.deeplearning.ai/how-to-build-a-career-in-ai-book) PDF from Andrew Ng.
|
19 |
-
|
20 |
-

|
21 |
-
|
22 |
-
---
|
23 |
|
24 |
## Features
|
25 |
|
26 |
-
-
|
27 |
-
-
|
28 |
-
-
|
29 |
-
-
|
30 |
-
-
|
31 |
-
- **OpenAI Language Models**: Use `gpt-3.5-turbo` embedding model for answer generation.
|
32 |
-
- **Streamlit UI**: Interactive and user-friendly web interface.
|
33 |
|
34 |
-
##
|
35 |
|
36 |
-
|
|
|
37 |
|
38 |
-
|
39 |
-
git clone https://github.com/vinhnx/InkChatGPT.git
|
40 |
-
```
|
41 |
|
42 |
-
|
43 |
|
44 |
-
```
|
|
|
45 |
cd InkChatGPT
|
46 |
```
|
47 |
|
48 |
-
|
49 |
-
|
50 |
-
4. Install the required packages:
|
51 |
|
52 |
-
```
|
53 |
-
|
|
|
54 |
```
|
55 |
|
56 |
-
|
57 |
|
58 |
-
```
|
59 |
pip install -r requirements.txt
|
60 |
```
|
61 |
|
62 |
## Usage
|
63 |
|
64 |
-
1.
|
65 |
-
|
66 |
-
- Open Visual Studio Code.
|
67 |
-
- Open the Command Palette by pressing `Ctrl+Shift+P` (Windows/Linux) or `Cmd+Shift+P` (macOS).
|
68 |
-
- Search for "Python: Create Environment" and select it.
|
69 |
-
- Choose the option to create a new virtual environment.
|
70 |
-
- Give the environment a name (e.g., "llm-rag-env") and select the Python interpreter version you want to use.
|
71 |
|
72 |
-
2.
|
73 |
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
3. **Open the Project Folder**:
|
78 |
-
|
79 |
-
- From the File menu, choose "Open Folder" or "Open..." and navigate to the project folder containing the `app.py` file.
|
80 |
-
|
81 |
-
4. **Configure the App**:
|
82 |
-
|
83 |
-
- Navigate to OpenAI Platform > API Keys to generate an API Key to run the model
|
84 |
-
- Copy the API KEY (start with sk-)
|
85 |
-
|
86 |
-
5. **Run the Streamlit App**:
|
87 |
-
|
88 |
-
- In the terminal, navigate to the project directory if you're not already there.
|
89 |
-
- Run the following command to start the Streamlit app:
|
90 |
-
```shellscript
|
91 |
-
streamlit run app.py
|
92 |
-
```
|
93 |
-
- This will start the Streamlit app and provide you with a local URL to access the app in your web browser.
|
94 |
-
- Pass your OpenAI API key into the `OpenAI API Key` field
|
95 |
-
|
96 |
-
6. **Use the App**:
|
97 |
|
98 |
-
|
99 |
-
- You should see the InkChatGPT interface.
|
100 |
-
- Follow the instructions in the app to upload documents and ask questions.
|
101 |
|
102 |
## Contributing
|
103 |
|
104 |
-
Contributions are welcome!
|
105 |
-
|
106 |
-
1. Fork the repository
|
107 |
-
2. Create a new branch: `git checkout -b feature/my-feature`
|
108 |
-
3. Commit your changes: `git commit -am 'Add some feature'`
|
109 |
-
4. Push to the branch: `git push origin feature/my-feature`
|
110 |
-
5. Create a new Pull Request
|
111 |
|
112 |
## License
|
113 |
|
114 |
This project is licensed under the [MIT License](LICENSE).
|
115 |
-
|
116 |
-
## Contact
|
117 |
-
|
118 |
-
I'm Vinh, [@vinhnx](https://x.com/vinhnx) on almost everywhere. Feel free to reach out with any questions or feedback!
|
|
|
4 |
|
5 |
# π [InkChatGPT](https://inkchatgpt.streamlit.app) [](https://inkchatgpt.streamlit.app)
|
6 |
|
7 |
+
`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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
## Features
|
10 |
|
11 |
+
- Upload any PDF documents and start asking key information about it
|
12 |
+
- Conversational Q&A with LLM (powered by `OpenAI`'s GPT-3.5-turbo model)
|
13 |
+
- Use `HuggingFace` embeddings to generate embeddings for the document chunks with `all-MiniLM-L6-v2` model.
|
14 |
+
- Clear conversation history
|
15 |
+
- Responsive UI with loading indicators and chat interface
|
|
|
|
|
16 |
|
17 |
+
## Prerequisites
|
18 |
|
19 |
+
- Python 3.7 or later
|
20 |
+
- OpenAI API key (set as an environment variable: `OPENAI_API_KEY`)
|
21 |
|
22 |
+
## Installation
|
|
|
|
|
23 |
|
24 |
+
1. Clone the repository:
|
25 |
|
26 |
+
```sh
|
27 |
+
git clone https://github.com/your-username/InkChatGPT.git
|
28 |
cd InkChatGPT
|
29 |
```
|
30 |
|
31 |
+
2. Create a virtual environment and activate it:
|
|
|
|
|
32 |
|
33 |
+
```sh
|
34 |
+
python -m venv env
|
35 |
+
source env/bin/activate # On Windows, use env\Scripts\activate
|
36 |
```
|
37 |
|
38 |
+
3. Install the required dependencies:
|
39 |
|
40 |
+
```sh
|
41 |
pip install -r requirements.txt
|
42 |
```
|
43 |
|
44 |
## Usage
|
45 |
|
46 |
+
1. Set the `OPENAI_API_KEY` environment variable with your OpenAI API key:
|
47 |
+
export OPENAI_API_KEY=YOUR_API_KEY
|
|
|
|
|
|
|
|
|
|
|
48 |
|
49 |
+
2. Run the Streamlit app:
|
50 |
|
51 |
+
```sh
|
52 |
+
streamlit run app.py
|
53 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
|
55 |
+
3. Upload PDF documents and start chatting with the LLM!
|
|
|
|
|
56 |
|
57 |
## Contributing
|
58 |
|
59 |
+
Contributions are welcome! Please open an issue or submit a pull request if you have any improvements or bug fixes.
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
|
61 |
## License
|
62 |
|
63 |
This project is licensed under the [MIT License](LICENSE).
|
|
|
|
|
|
|
|