mikepastor11 commited on
Commit
b31777c
1 Parent(s): d181195

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -18
app.py CHANGED
@@ -47,29 +47,32 @@ def get_text_chunks(text):
47
  return chunks
48
 
49
 
50
- # def get_vectorstore(text_chunks):
51
- # # embeddings = OpenAIEmbeddings()
52
 
53
- # # pip install InstructorEmbedding
54
- # # pip install sentence-transformers==2.2.2
55
- # embeddings = HuggingFaceInstructEmbeddings(model_name="hkunlp/instructor-xl")
56
 
57
- # # from InstructorEmbedding import INSTRUCTOR
58
- # # model = INSTRUCTOR('hkunlp/instructor-xl')
59
- # # sentence = "3D ActionSLAM: wearable person tracking in multi-floor environments"
60
- # # instruction = "Represent the Science title:"
61
- # # embeddings = model.encode([[instruction, sentence]])
62
 
63
- # # embeddings = model.encode(text_chunks)
64
- # print('have Embeddings: ')
 
 
 
 
65
 
66
- # # text_chunks="this is a test"
67
- # # FAISS, Chroma and other vector databases
68
- # #
69
- # vectorstore = FAISS.from_texts(texts=text_chunks, embedding=embeddings)
70
- # print('FAISS succeeds: ')
71
 
72
- # return vectorstore
 
 
 
 
 
 
73
 
74
  # def get_conversation_chain(vectorstore):
75
  # # llm = ChatOpenAI()
 
47
  return chunks
48
 
49
 
50
+ def get_vectorstore(text_chunks):
 
51
 
52
+ st.write('Here in vector store....', unsafe_allow_html=True)
53
+ # embeddings = OpenAIEmbeddings()
 
54
 
55
+ # pip install InstructorEmbedding
56
+ # pip install sentence-transformers==2.2.2
57
+ embeddings = HuggingFaceInstructEmbeddings(model_name="hkunlp/instructor-xl")
 
 
58
 
59
+ st.write('Here in vector store - got embeddings ', unsafe_allow_html=True)
60
+ # from InstructorEmbedding import INSTRUCTOR
61
+ # model = INSTRUCTOR('hkunlp/instructor-xl')
62
+ # sentence = "3D ActionSLAM: wearable person tracking in multi-floor environments"
63
+ # instruction = "Represent the Science title:"
64
+ # embeddings = model.encode([[instruction, sentence]])
65
 
66
+ # embeddings = model.encode(text_chunks)
67
+ print('have Embeddings: ')
 
 
 
68
 
69
+ # text_chunks="this is a test"
70
+ # FAISS, Chroma and other vector databases
71
+ #
72
+ # vectorstore = FAISS.from_texts(texts=text_chunks, embedding=embeddings)
73
+ print('FAISS succeeds: ')
74
+
75
+ return vectorstore
76
 
77
  # def get_conversation_chain(vectorstore):
78
  # # llm = ChatOpenAI()