Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -24,7 +24,7 @@ def pdf_changes(pdf_doc, open_ai_key):
|
|
24 |
os.environ['OPENAI_API_KEY'] = open_ai_key
|
25 |
loader = OnlinePDFLoader(pdf_doc.name)
|
26 |
documents = loader.load()
|
27 |
-
text_splitter = CharacterTextSplitter(chunk_size=
|
28 |
texts = text_splitter.split_documents(documents)
|
29 |
embeddings = OpenAIEmbeddings()
|
30 |
db = Chroma.from_documents(texts, embeddings)
|
|
|
24 |
os.environ['OPENAI_API_KEY'] = open_ai_key
|
25 |
loader = OnlinePDFLoader(pdf_doc.name)
|
26 |
documents = loader.load()
|
27 |
+
text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)
|
28 |
texts = text_splitter.split_documents(documents)
|
29 |
embeddings = OpenAIEmbeddings()
|
30 |
db = Chroma.from_documents(texts, embeddings)
|