samim2024 commited on
Commit
d20c40b
·
verified ·
1 Parent(s): 9ad6ba3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -53,8 +53,8 @@ def create_langchain_index(input_text):
53
  get_text(input_text)
54
  loader = TextLoader("text\\temp.txt", encoding='utf-8')
55
  # data = loader.load()
56
-
57
- index = VectorstoreIndexCreator(vectorstore_cls=DocArrayInMemorySearch,embedding=model.encode(input_text)).from_loaders([loader])
58
  return index
59
 
60
  # @st.cache_resource
 
53
  get_text(input_text)
54
  loader = TextLoader("text\\temp.txt", encoding='utf-8')
55
  # data = loader.load()
56
+ embeddings = model.encode(input_text)
57
+ index = VectorstoreIndexCreator(vectorstore_cls=DocArrayInMemorySearch,embedding=embeddings).from_loaders([loader])
58
  return index
59
 
60
  # @st.cache_resource