ahmadmac commited on
Commit
a4e7528
·
verified ·
1 Parent(s): 92868fe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -14,8 +14,9 @@ with open("brookline_data.txt", "r") as f:
14
  text_splitter = RecursiveCharacterTextSplitter(chunk_size=100, chunk_overlap=20)
15
  splitted_data = text_splitter.split_text(data)
16
  embeddings = HuggingFaceEmbeddings(model_name='sentence-transformers/all-mpnet-base-v2')
17
- retriever = Qdrant.as_retriever(self)
18
-
 
19
  llm = HuggingFaceHub(repo_id="ahmadmac/Trained-T5-large", model_kwargs={"temperature": 0.5, "max_length": 512},huggingfacehub_api_token=hf_token)
20
  qna = RetrievalQA.from_chain_type(llm=llm, chain_type="stuff", retriever=retriever)
21
  prompt_template = """ you are a highly knowledgeable AI assistant. Engage in a conversation with the user. Your main goal is to provide clear and informative answers to the user's questions.
 
14
  text_splitter = RecursiveCharacterTextSplitter(chunk_size=100, chunk_overlap=20)
15
  splitted_data = text_splitter.split_text(data)
16
  embeddings = HuggingFaceEmbeddings(model_name='sentence-transformers/all-mpnet-base-v2')
17
+ #retriever = Qdrant.as_retriever()
18
+ qdrant_vectorstore = Qdrant(client, embeddings.embed_query, collection_name="my_documents")
19
+ retriever = qdrant_vectorstore.as_retriever()
20
  llm = HuggingFaceHub(repo_id="ahmadmac/Trained-T5-large", model_kwargs={"temperature": 0.5, "max_length": 512},huggingfacehub_api_token=hf_token)
21
  qna = RetrievalQA.from_chain_type(llm=llm, chain_type="stuff", retriever=retriever)
22
  prompt_template = """ you are a highly knowledgeable AI assistant. Engage in a conversation with the user. Your main goal is to provide clear and informative answers to the user's questions.