final push
Browse files- Open_Source_RAG_Leveraging_Hugging_Face_Endpoints_through_LangChain.ipynb +1 -1
- README.md +11 -1
- app.py +3 -3
- chainlit.md +1 -1
Open_Source_RAG_Leveraging_Hugging_Face_Endpoints_through_LangChain.ipynb
CHANGED
@@ -35,7 +35,7 @@
|
|
35 |
},
|
36 |
{
|
37 |
"cell_type": "code",
|
38 |
-
"execution_count":
|
39 |
"metadata": {
|
40 |
"id": "EwGLnp31jXJj"
|
41 |
},
|
|
|
35 |
},
|
36 |
{
|
37 |
"cell_type": "code",
|
38 |
+
"execution_count": 1,
|
39 |
"metadata": {
|
40 |
"id": "EwGLnp31jXJj"
|
41 |
},
|
README.md
CHANGED
@@ -1 +1,11 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
title: Midterm-app
|
3 |
+
emoji: 📉
|
4 |
+
colorFrom: pink
|
5 |
+
colorTo: yellow
|
6 |
+
sdk: docker
|
7 |
+
pinned: false
|
8 |
+
app_port: 7860
|
9 |
+
---
|
10 |
+
|
11 |
+
### Hello, i am Paul Graham bot. Feel free to ask me any questions regarding Paul Graham.
|
app.py
CHANGED
@@ -43,17 +43,17 @@ text_loader = TextLoader("./data/paul_graham_essays.txt")
|
|
43 |
documents = text_loader.load()
|
44 |
|
45 |
### 2. CREATE TEXT SPLITTER AND SPLIT DOCUMENTS
|
46 |
-
text_splitter = RecursiveCharacterTextSplitter(chunk_size=
|
47 |
split_documents = text_splitter.split_documents(documents)
|
48 |
|
49 |
### 3. LOAD HUGGINGFACE EMBEDDINGS
|
50 |
hf_embeddings = HuggingFaceEndpointEmbeddings(
|
51 |
model=HF_EMBED_ENDPOINT,
|
52 |
task="feature-extraction",
|
53 |
-
huggingfacehub_api_token=
|
54 |
)
|
55 |
|
56 |
-
if os.path.exists("./data/vectorstore"):
|
57 |
vectorstore = FAISS.load_local(
|
58 |
"./data/vectorstore",
|
59 |
hf_embeddings,
|
|
|
43 |
documents = text_loader.load()
|
44 |
|
45 |
### 2. CREATE TEXT SPLITTER AND SPLIT DOCUMENTS
|
46 |
+
text_splitter = RecursiveCharacterTextSplitter(chunk_size=800, chunk_overlap=40)
|
47 |
split_documents = text_splitter.split_documents(documents)
|
48 |
|
49 |
### 3. LOAD HUGGINGFACE EMBEDDINGS
|
50 |
hf_embeddings = HuggingFaceEndpointEmbeddings(
|
51 |
model=HF_EMBED_ENDPOINT,
|
52 |
task="feature-extraction",
|
53 |
+
huggingfacehub_api_token=HF_TOKEN
|
54 |
)
|
55 |
|
56 |
+
if os.path.exists("./data/vectorstore/index.faiss"):
|
57 |
vectorstore = FAISS.load_local(
|
58 |
"./data/vectorstore",
|
59 |
hf_embeddings,
|
chainlit.md
CHANGED
@@ -1 +1 @@
|
|
1 |
-
# Hello
|
|
|
1 |
+
# Hello, i am Paul Graham bot. Feel free to ask me any questions regarding Paul Graham.
|