Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,7 @@ from PyPDF2 import PdfReader
|
|
3 |
from langchain.text_splitter import RecursiveCharacterTextSplitter
|
4 |
import os
|
5 |
from langchain_google_genai import GoogleGenerativeAIEmbeddings
|
|
|
6 |
import google.generativeai as genai
|
7 |
from langchain.vectorstores import FAISS
|
8 |
from langchain_google_genai import ChatGoogleGenerativeAI
|
@@ -22,7 +23,7 @@ def get_pdf_text(pdf_docs):
|
|
22 |
return text
|
23 |
|
24 |
def get_text_chunks(text):
|
25 |
-
text_splitter = RecursiveCharacterTextSplitter(chunk_size=
|
26 |
chunks = text_splitter.split_text(text)
|
27 |
return chunks
|
28 |
|
|
|
3 |
from langchain.text_splitter import RecursiveCharacterTextSplitter
|
4 |
import os
|
5 |
from langchain_google_genai import GoogleGenerativeAIEmbeddings
|
6 |
+
from langchain.embeddings import HuggingFaceInferenceAPIEmbeddings
|
7 |
import google.generativeai as genai
|
8 |
from langchain.vectorstores import FAISS
|
9 |
from langchain_google_genai import ChatGoogleGenerativeAI
|
|
|
23 |
return text
|
24 |
|
25 |
def get_text_chunks(text):
|
26 |
+
text_splitter = RecursiveCharacterTextSplitter(chunk_size=700, chunk_overlap=200)
|
27 |
chunks = text_splitter.split_text(text)
|
28 |
return chunks
|
29 |
|