Spaces:
Runtime error
Runtime error
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
@@ -35,7 +35,11 @@ openai.api_key = os.getenv("OPENAI_API_KEY")
|
|
35 |
# query into a vector
|
36 |
embeddings = OpenAIEmbeddings(model="text-embedding-ada-002") #, chunk_size=1)
|
37 |
|
38 |
-
dbclient = QdrantClient("localhost", port=6333, grpc_port=6334, prefer_grpc=True)
|
|
|
|
|
|
|
|
|
39 |
|
40 |
index=Qdrant(client=dbclient, collection_name=collection_name, embeddings=embeddings, vector_name="fragmentvector")
|
41 |
|
@@ -95,4 +99,4 @@ with gr.Blocks(title="Collective Agreement Search") as blocks:
|
|
95 |
question.submit(docquery, question, outputs=[answer, references])
|
96 |
|
97 |
|
98 |
-
blocks.launch(share=
|
|
|
35 |
# query into a vector
|
36 |
embeddings = OpenAIEmbeddings(model="text-embedding-ada-002") #, chunk_size=1)
|
37 |
|
38 |
+
# dbclient = QdrantClient("localhost", port=6333, grpc_port=6334, prefer_grpc=True)
|
39 |
+
qdrant_client = QdrantClient(
|
40 |
+
url="https://926bd417-9b52-4f28-9671-2e2232726856.us-east-1-0.aws.cloud.qdrant.io:6333",
|
41 |
+
api_key="RBXhkIN_NzvAb4z3sjOktZeIPSFylMgCdendwrqCLllyEQlV-aTlUg",
|
42 |
+
)
|
43 |
|
44 |
index=Qdrant(client=dbclient, collection_name=collection_name, embeddings=embeddings, vector_name="fragmentvector")
|
45 |
|
|
|
99 |
question.submit(docquery, question, outputs=[answer, references])
|
100 |
|
101 |
|
102 |
+
blocks.launch(share=False, server_name="0.0.0.0", server_port=8080)
|