Spaces:
Running
Running
MVPilgrim
commited on
Commit
·
a94a34d
1
Parent(s):
50fe8c3
debug
Browse files
README.md
CHANGED
@@ -4,17 +4,16 @@ emoji: 😻
|
|
4 |
colorFrom: red
|
5 |
colorTo: indigo
|
6 |
sdk: docker
|
7 |
-
sdk_version: 3.40.1
|
8 |
-
app_port: 7860
|
9 |
-
suggested_storage: large
|
10 |
app_file: app.py
|
11 |
-
pinned: false
|
12 |
startup_duration_timeout: 3 hours
|
13 |
---
|
14 |
|
15 |
# Retrieval Augmented Generation with Large Language Models
|
16 |
|
17 |
-
|
18 |
This project serves as a Proof-of-Concept for implementing Retrieval Augmented Generation (RAG) when prompting Large Language Models (LLMs). It is a learning exercise aimed at enabling future LLM-based applications by leveraging the power of RAG techniques.
|
19 |
|
20 |
## Components
|
@@ -35,26 +34,33 @@ The project incorporates the following key components:
|
|
35 |
## Application Notes
|
36 |
|
37 |
As part of the initialization process, the application executes a Bash script asynchronously. The script follows these steps:
|
|
|
|
|
|
|
|
|
|
|
38 |
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
4. Finally, the script waits to ensure that its subprocesses continue to execute.
|
43 |
|
44 |
## Usage
|
45 |
|
46 |
To use the application, follow these steps:
|
47 |
|
48 |
-
|
49 |
-
|
50 |
-
|
|
|
51 |
|
52 |
## Future Improvements
|
53 |
|
54 |
The following areas have been identified for future improvements:
|
55 |
|
56 |
-
- Ensure that Retrieval Augmented Generation (RAG) is functioning correctly
|
57 |
-
|
58 |
-
|
59 |
-
-
|
|
|
|
|
60 |
|
|
|
4 |
colorFrom: red
|
5 |
colorTo: indigo
|
6 |
sdk: docker
|
7 |
+
#sdk_version: 3.40.1
|
8 |
+
#app_port: 7860
|
9 |
+
#suggested_storage: large
|
10 |
app_file: app.py
|
11 |
+
#pinned: false
|
12 |
startup_duration_timeout: 3 hours
|
13 |
---
|
14 |
|
15 |
# Retrieval Augmented Generation with Large Language Models
|
16 |
|
|
|
17 |
This project serves as a Proof-of-Concept for implementing Retrieval Augmented Generation (RAG) when prompting Large Language Models (LLMs). It is a learning exercise aimed at enabling future LLM-based applications by leveraging the power of RAG techniques.
|
18 |
|
19 |
## Components
|
|
|
34 |
## Application Notes
|
35 |
|
36 |
As part of the initialization process, the application executes a Bash script asynchronously. The script follows these steps:
|
37 |
+
- It starts the text2vec-transformers Weaviate module first.
|
38 |
+
- Then, it starts the Weaviate database server itself.
|
39 |
+
- Both programs run as subprocesses to the script.
|
40 |
+
- Finally, the script waits to ensure that its subprocesses continue to execute so that app.py
|
41 |
+
can use the database for RAG functions.
|
42 |
|
43 |
+
Also, the vector database is only loaded with two collections/schemas based on one webpage each
|
44 |
+
from Wikipedia. One page has content related to artifical intelligence and the other content
|
45 |
+
about Norwegian literature.
|
|
|
46 |
|
47 |
## Usage
|
48 |
|
49 |
To use the application, follow these steps:
|
50 |
|
51 |
+
- Type in a prompt and an optional system prompt (e.g., "You are a helpful AI assistant.") in the provided input fields.
|
52 |
+
- Click the "Run LLM Prompt" button to initiate the processing of the prompt by the llama-2 LLM.
|
53 |
+
- Once the processing is complete, the generated completion will be displayed along with the user's prompt and system prompt.
|
54 |
+
- Click the "Get All Rag Data" button to view information on the two documents in the database including chunks.
|
55 |
|
56 |
## Future Improvements
|
57 |
|
58 |
The following areas have been identified for future improvements:
|
59 |
|
60 |
+
- Ensure that Retrieval Augmented Generation (RAG) is functioning correctly. When a prompt is created
|
61 |
+
with RAG data, it appears to llama-2 is considering the information along with information it has
|
62 |
+
been trained with. But more testing is needed.
|
63 |
+
- Also to this end, add web pages with details on a topic that the LLM won't have been trained with. Compare prompts with
|
64 |
+
and without RAG.
|
65 |
+
- Experiment with different database settings on queries such as the distance parameter on the collection query.near_vector() call.
|
66 |
|