Spaces:
Runtime error
Runtime error
Commit
·
36f3f56
1
Parent(s):
02bce47
Update app.py
Browse files
app.py
CHANGED
@@ -5,9 +5,9 @@ from langchain.embeddings import HuggingFaceEmbeddings
|
|
5 |
from langchain.text_splitter import CharacterTextSplitter
|
6 |
embeddings = HuggingFaceEmbeddings()
|
7 |
g=open('Gita.txt')
|
8 |
-
|
9 |
text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)
|
10 |
-
texts = text_splitter.split_text(
|
11 |
docsearch = Chroma.from_texts(texts, embeddings)
|
12 |
def answer(query):
|
13 |
docs = docsearch.similarity_search(query)
|
|
|
5 |
from langchain.text_splitter import CharacterTextSplitter
|
6 |
embeddings = HuggingFaceEmbeddings()
|
7 |
g=open('Gita.txt')
|
8 |
+
Gita=g.read()
|
9 |
text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)
|
10 |
+
texts = text_splitter.split_text(Gita)
|
11 |
docsearch = Chroma.from_texts(texts, embeddings)
|
12 |
def answer(query):
|
13 |
docs = docsearch.similarity_search(query)
|