Spaces:
Sleeping
Sleeping
Add README file
Browse files- README.md +92 -0
- img/screenshot.jpg +0 -0
README.md
ADDED
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# InkChatGPT
|
2 |
+
|
3 |
+
A Simple LLM app that demonstrates a Retrieval-Augmented Generation (RAG) model for question-answering using LangChain, ChromaDB, and OpenAI's language models.
|
4 |
+
|
5 |
+
The app allows users to upload documents (PDFs or text files), and then ask questions related to the content of those documents.
|
6 |
+
|
7 |
+
The RAG model retrieves relevant passages from the documents and generates an answer based on the retrieved context.
|
8 |
+
|
9 |
+
---
|
10 |
+
|
11 |
+

|
12 |
+
|
13 |
+
---
|
14 |
+
|
15 |
+
## Table of Contents
|
16 |
+
|
17 |
+
- [Installation](#installation)
|
18 |
+
- [Usage](#usage)
|
19 |
+
- [Contributing](#contributing)
|
20 |
+
- [License](#license)
|
21 |
+
|
22 |
+
# Usage
|
23 |
+
|
24 |
+
Clone the repository:
|
25 |
+
|
26 |
+
```bash
|
27 |
+
git clone https://github.com/vinhnx/InkChatGPT.git
|
28 |
+
```
|
29 |
+
|
30 |
+
1. **Open VSCode and Create a New Python Environment**:
|
31 |
+
|
32 |
+
- Open Visual Studio Code.
|
33 |
+
- Open the Command Palette by pressing `Ctrl+Shift+P` (Windows/Linux) or `Cmd+Shift+P` (macOS).
|
34 |
+
- Search for "Python: Create Environment" and select it.
|
35 |
+
- Choose the option to create a new virtual environment.
|
36 |
+
- Give the environment a name (e.g., "llm-rag-env") and select the Python interpreter version you want to use.
|
37 |
+
|
38 |
+
2. **Select the Python Interpreter**:
|
39 |
+
|
40 |
+
- Once the virtual environment is created, you'll be prompted to select the Python interpreter.
|
41 |
+
- From the Command Palette, search for "Python: Select Interpreter" and choose the interpreter you just created (e.g., "llm-rag-env").
|
42 |
+
|
43 |
+
3. **Open the Project Folder**:
|
44 |
+
|
45 |
+
- From the File menu, choose "Open Folder" or "Open..." and navigate to the project folder containing the `app.py` file.
|
46 |
+
|
47 |
+
4. **Install Required Packages**:
|
48 |
+
|
49 |
+
- Open a new Terminal in VSCode by clicking "Terminal" > "New Terminal" or pressing `Ctrl+Shift+`" (Windows/Linux) or `Cmd+Shift+`" (macOS).
|
50 |
+
- In the terminal, run the following command to install the required packages:
|
51 |
+
```
|
52 |
+
pip install streamlit langchain chromadb openai tiktoken pypdf
|
53 |
+
```
|
54 |
+
|
55 |
+
5. **Configure the App**:
|
56 |
+
|
57 |
+
- Open the `app.py` file in the VSCode editor.
|
58 |
+
- Set your OpenAI API key by modifying the `OPENAI_API_KEY` variable.
|
59 |
+
- Optionally, you can change the `CHROMA_PERSIST_DIRECTORY` and `OPENAI_MODEL` variables according to your preferences.
|
60 |
+
|
61 |
+
6. **Run the Streamlit App**:
|
62 |
+
|
63 |
+
- In the terminal, navigate to the project directory if you're not already there.
|
64 |
+
- Run the following command to start the Streamlit app:
|
65 |
+
```
|
66 |
+
streamlit run app.py
|
67 |
+
```
|
68 |
+
- This will start the Streamlit app and provide you with a local URL to access the app in your web browser.
|
69 |
+
|
70 |
+
7. **Use the App**:
|
71 |
+
|
72 |
+
- Open the provided local URL in your web browser.
|
73 |
+
- You should see the InkChatGPT interface.
|
74 |
+
- Follow the instructions in the app to upload documents and ask questions.
|
75 |
+
|
76 |
+
## Contributing
|
77 |
+
|
78 |
+
Contributions are welcome! If you'd like to improve the Medium Article Generator, please follow these steps:
|
79 |
+
|
80 |
+
1. Fork the repository
|
81 |
+
1. Create a new branch `git checkout -b feature/my-feature`
|
82 |
+
1. Commit your changes `git commit -am 'Add some feature'`
|
83 |
+
1. Push to the branch `git push origin feature/my-feature`
|
84 |
+
1. Create a new Pull Request
|
85 |
+
|
86 |
+
## License
|
87 |
+
|
88 |
+
This project is licensed under the MIT License.
|
89 |
+
|
90 |
+
## Contact
|
91 |
+
|
92 |
+
I'm Vinh, [@vinhnx](https://x.com/vinhnx) on almost everywhere.
|
img/screenshot.jpg
ADDED
![]() |