EnverLee commited on
Commit
2416d1d
β€’
1 Parent(s): c0510b0

application

Browse files
.DS_Store ADDED
Binary file (6.15 kB). View file
 
README.md CHANGED
@@ -1,13 +1,41 @@
1
- ---
2
- title: Laweye Docker
3
- emoji: πŸ¦€
4
- colorFrom: yellow
5
- colorTo: pink
6
- sdk: gradio
7
- sdk_version: 4.41.0
8
- app_file: app.py
9
- pinned: false
10
- license: mit
11
- ---
12
-
13
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Retrieval Augmented Generation
2
+
3
+ This repository contains code and resources related to Retrieval Augmented Generation (RAG), a technique designed to address the data freshness problem in Large Language Models (LLMs) like Llama-2. LLMs often lack awareness of recent events and up-to-date information. RAG incorporates external knowledge from a knowledge base into LLM responses, enabling accurate and well-grounded responses.
4
+
5
+ ## Repository Contents
6
+
7
+ - `src`: Contains the source code for implementing the RAG technique and interactions with the knowledge base.
8
+ - `data`: Stores datasets and relevant resources for building the knowledge base.
9
+ - `db`: To manage and store token embeddings or vector representations for knowledge base searches.
10
+ - `requirements.txt`: Required Python packages to run the code in this repository.
11
+
12
+ ## About RAG (Retrieval Augmented Generation)
13
+
14
+ RAG is a novel approach combining Large Language Models (LLMs) capabilities with external knowledge bases to enhance the quality and freshness of generated responses. It addresses the challenge of outdated information by retrieving contextually relevant knowledge from external sources and incorporating it into LLM-generated content.
15
+
16
+ ## About Gradio
17
+
18
+ [Gradio](https://www.gradio.app) is a Python library that helps you quickly create UIs for your machine learning models. It allows you to quickly deploy models and make them accessible through a user-friendly interface without extensive frontend development.
19
+
20
+ A Gradio app is launched when `gradio_chatbot.py` code is run. It contains modifiable elements such as the Embedding model, Generation model, editable system prompt, and tunable parameters of the chosen LLM.
21
+
22
+ ### Steps
23
+
24
+ To use the code in this repository, follow these steps:
25
+
26
+ 1. Clone the repository to your local machine.
27
+ 2. Navigate to the repository directory using the command line.
28
+ 3. Install the required packages using the following command:
29
+
30
+ ```bash
31
+ pip install -r requirements.txt
32
+ ```
33
+
34
+ 4. Run the chatbot application using the command:
35
+
36
+ ```bash
37
+ python src/gradio_chatbot.py
38
+ ```
39
+
40
+ 5. Once the Gradio app is up, upload a document (pdf or csv), choose the models (embedding and generation), adjust the tunable parameters, fiddle with the system prompt, and ask anything you need!
41
+
{gradio_RAG-main/data β†’ data}/1909.09586.pdf RENAMED
File without changes
{gradio_RAG-main/db β†’ db}/faiss_index/index.faiss RENAMED
File without changes
{gradio_RAG-main/db β†’ db}/faiss_index/index.pkl RENAMED
File without changes
gradio_RAG-main/README.md DELETED
@@ -1,41 +0,0 @@
1
- # Retrieval Augmented Generation
2
-
3
- This repository contains code and resources related to Retrieval Augmented Generation (RAG), a technique designed to address the data freshness problem in Large Language Models (LLMs) like Llama-2. LLMs often lack awareness of recent events and up-to-date information. RAG incorporates external knowledge from a knowledge base into LLM responses, enabling accurate and well-grounded responses.
4
-
5
- ## Repository Contents
6
-
7
- - `src`: Contains the source code for implementing the RAG technique and interactions with the knowledge base.
8
- - `data`: Stores datasets and relevant resources for building the knowledge base.
9
- - `db`: To manage and store token embeddings or vector representations for knowledge base searches.
10
- - `requirements.txt`: Required Python packages to run the code in this repository.
11
-
12
- ## About RAG (Retrieval Augmented Generation)
13
-
14
- RAG is a novel approach combining Large Language Models (LLMs) capabilities with external knowledge bases to enhance the quality and freshness of generated responses. It addresses the challenge of outdated information by retrieving contextually relevant knowledge from external sources and incorporating it into LLM-generated content.
15
-
16
- ## About Gradio
17
-
18
- [Gradio](https://www.gradio.app) is a Python library that helps you quickly create UIs for your machine learning models. It allows you to quickly deploy models and make them accessible through a user-friendly interface without extensive frontend development.
19
-
20
- A Gradio app is launched when `gradio_chatbot.py` code is run. It contains modifiable elements such as the Embedding model, Generation model, editable system prompt, and tunable parameters of the chosen LLM.
21
-
22
- ### Steps
23
-
24
- To use the code in this repository, follow these steps:
25
-
26
- 1. Clone the repository to your local machine.
27
- 2. Navigate to the repository directory using the command line.
28
- 3. Install the required packages using the following command:
29
-
30
- ```bash
31
- pip install -r requirements.txt
32
- ```
33
-
34
- 4. Run the chatbot application using the command:
35
-
36
- ```bash
37
- python src/gradio_chatbot.py
38
- ```
39
-
40
- 5. Once the Gradio app is up, upload a document (pdf or csv), choose the models (embedding and generation), adjust the tunable parameters, fiddle with the system prompt, and ask anything you need!
41
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
gradio_RAG-main/requirements.txt β†’ requirements.txt RENAMED
File without changes
{gradio_RAG-main/src β†’ src}/gradio_chatbot.py RENAMED
File without changes
{gradio_RAG-main/src β†’ src}/model_setup.py RENAMED
File without changes
{gradio_RAG-main/src β†’ src}/model_utils.py RENAMED
File without changes
{gradio_RAG-main/src β†’ src}/util/conversation_rag.py RENAMED
File without changes
{gradio_RAG-main/src β†’ src}/util/index.py RENAMED
File without changes