Spaces:
Runtime error
Runtime error
Update app_v1.py
Browse files
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
|
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 |
-
#
|
57 |
embedding_model = SentenceTransformer('Cheselle/finetuned-arctic-sentence')
|
58 |
|
59 |
-
# Create the Qdrant vector store using the 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 |
)
|
|
|
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 |
)
|