Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -52,8 +52,8 @@ def create_langchain_index(input_text):
|
|
52 |
print("--indexing---")
|
53 |
get_text(input_text)
|
54 |
loader = TextLoader("text\\temp.txt", encoding='utf-8')
|
55 |
-
|
56 |
-
embeddings = model.encode(
|
57 |
index = VectorstoreIndexCreator(vectorstore_cls=DocArrayInMemorySearch,embedding=embeddings).from_loaders([loader])
|
58 |
return index
|
59 |
|
|
|
52 |
print("--indexing---")
|
53 |
get_text(input_text)
|
54 |
loader = TextLoader("text\\temp.txt", encoding='utf-8')
|
55 |
+
data = loader.load()
|
56 |
+
embeddings = model.encode(data)
|
57 |
index = VectorstoreIndexCreator(vectorstore_cls=DocArrayInMemorySearch,embedding=embeddings).from_loaders([loader])
|
58 |
return index
|
59 |
|