vinhnx90 commited on
Commit
a9cf382
β€’
1 Parent(s): 3373c54

Update README

Browse files
Files changed (1) hide show
  1. README.md +27 -82
README.md CHANGED
@@ -4,115 +4,60 @@
4
 
5
  # πŸ“š [InkChatGPT](https://inkchatgpt.streamlit.app) [![Streamlit App](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://inkchatgpt.streamlit.app)
6
 
7
- InkChatGPT is a Simple LLM app that demonstrates a Retrieval-Augmented Generation (RAG) model for question-answering using LangChain, ChromaDB, and OpenAI's language models.
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
- ![Demo Screenshot](./assets/demo.jpg)
21
-
22
- ---
23
 
24
  ## Features
25
 
26
- - **Document Upload**: Supports uploading PDF and text files.
27
- - **Question Answering**: Ask questions related to the uploaded documents.
28
- - **Retrieval-Augmented Generation (RAG)**: Utilizes a RAG model for context-aware question answering.
29
- - **LangChain Integration**: Leverages LangChain for building the RAG model.
30
- - **ChromaDB**: Efficient vector storage and retrieval using ChromaDB.
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
- ## Local Installation
35
 
36
- 1. Clone the repository:
 
37
 
38
- ```shellscript
39
- git clone https://github.com/vinhnx/InkChatGPT.git
40
- ```
41
 
42
- 2. Navigate to the project directory:
43
 
44
- ```shellscript
 
45
  cd InkChatGPT
46
  ```
47
 
48
- 3. Create a new Python environment and activate it (e.g., using `venv` or `conda`).
49
-
50
- 4. Install the required packages:
51
 
52
- ```shellscript
53
- pip install streamlit langchain chromadb openai tiktoken pypdf
 
54
  ```
55
 
56
- or, run
57
 
58
- ```shellscript
59
  pip install -r requirements.txt
60
  ```
61
 
62
  ## Usage
63
 
64
- 1. **Open VSCode and Create a New Python Environment**:
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. **Select the Python Interpreter**:
73
 
74
- - Once the virtual environment is created, you'll be prompted to select the Python interpreter.
75
- - From the Command Palette, search for "Python: Select Interpreter" and choose the interpreter you just created (e.g., "llm-rag-env").
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
- - Open the provided local URL in your web browser.
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! If you'd like to improve the InkChatGPT, please follow these steps:
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) [![Streamlit App](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](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).