Cheselle commited on
Commit
bda9a43
·
verified ·
1 Parent(s): d9ebda3

Update app_v1.py

Browse files
Files changed (1) hide show
  1. app_v1.py +4 -4
app_v1.py CHANGED
@@ -13,7 +13,7 @@ from langchain_community.vectorstores import Qdrant
13
  from langchain_core.runnables import RunnablePassthrough, RunnableParallel
14
  import chainlit as cl
15
  from pathlib import Path
16
- from sentence_transformers import SentenceTransformer # Ensure you import the SentenceTransformer
17
 
18
  load_dotenv()
19
 
@@ -53,13 +53,13 @@ async def on_chat_start():
53
 
54
  sentence_combined_documents = sentence_framework + sentence_blueprint
55
 
56
- # Correctly initialize the SentenceTransformer model
57
  embedding_model = SentenceTransformer('Cheselle/finetuned-arctic-sentence')
58
 
59
- # Create the Qdrant vector store using the embedding model instance
60
  sentence_vectorstore = Qdrant.from_documents(
61
  documents=sentence_combined_documents,
62
- embedding=embedding_model, # Ensure this is an instance, not a reference to a function
63
  location=":memory:",
64
  collection_name="AI Policy"
65
  )
 
13
  from langchain_core.runnables import RunnablePassthrough, RunnableParallel
14
  import chainlit as cl
15
  from pathlib import Path
16
+ from sentence_transformers import SentenceTransformer # Ensure this import is correct
17
 
18
  load_dotenv()
19
 
 
53
 
54
  sentence_combined_documents = sentence_framework + sentence_blueprint
55
 
56
+ # Initialize the SentenceTransformer model properly
57
  embedding_model = SentenceTransformer('Cheselle/finetuned-arctic-sentence')
58
 
59
+ # Create the Qdrant vector store using the initialized embedding model
60
  sentence_vectorstore = Qdrant.from_documents(
61
  documents=sentence_combined_documents,
62
+ embedding=embedding_model, # Ensure this is an instance
63
  location=":memory:",
64
  collection_name="AI Policy"
65
  )