Spaces:
Runtime error
Runtime error
π Add more info
Browse files
README.md
CHANGED
@@ -12,7 +12,7 @@ import os
|
|
12 |
|
13 |
os.environ["OPENAI_API_KEY"] = "my key"
|
14 |
|
15 |
-
# Create a bot
|
16 |
bot = QnABot(directory="./mydata")
|
17 |
|
18 |
# Ask a question
|
@@ -28,6 +28,7 @@ bot = QnABot(directory="./mydata", index="index.pickle")
|
|
28 |
### Future plans
|
29 |
|
30 |
- [ ] Add support for other models
|
|
|
31 |
- [ ] Add support for other data sources
|
32 |
- [ ] Add support for other vector databases
|
33 |
- [ ] One line API expose
|
@@ -35,7 +36,11 @@ bot = QnABot(directory="./mydata", index="index.pickle")
|
|
35 |
|
36 |
### Here's how it works
|
37 |
|
38 |
-
|
|
|
|
|
|
|
|
|
39 |
|
40 |
```mermaid
|
41 |
sequenceDiagram
|
|
|
12 |
|
13 |
os.environ["OPENAI_API_KEY"] = "my key"
|
14 |
|
15 |
+
# Create a bot π with one line of code
|
16 |
bot = QnABot(directory="./mydata")
|
17 |
|
18 |
# Ask a question
|
|
|
28 |
### Future plans
|
29 |
|
30 |
- [ ] Add support for other models
|
31 |
+
- [ ] Add support for different prompts
|
32 |
- [ ] Add support for other data sources
|
33 |
- [ ] Add support for other vector databases
|
34 |
- [ ] One line API expose
|
|
|
36 |
|
37 |
### Here's how it works
|
38 |
|
39 |
+
Large language models (LLMs) are powerful, but they can't answer questions about documents they haven't seen. If you want to use an LLM to answer questions about documents it was not trained on, you have to give it information about those documents. To solve this, we use "retrieval augmented generation."
|
40 |
+
|
41 |
+
In simple terms, when you have a question, you first search for relevant documents. Then, you give the documents and the question to the language model to generate an answer. To make this work, you need your documents in a searchable format (an index). This process involves two main steps: (1) preparing your documents for easy querying, and (2) using the retrieval augmented generation method.
|
42 |
+
|
43 |
+
`QnABot` uses FAISS to create an index of documents and GPT to generate answers.
|
44 |
|
45 |
```mermaid
|
46 |
sequenceDiagram
|