Spaces:
Running
Running
worked on gradio inteface for chatbot experimenter
Browse files
config/settings.py
CHANGED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
EMBEDDINGS_MODEL_NAME = "text-embedding-3-large"
|
config.py β notebooks/02 Chatbot with custom system prompt.ipynb
RENAMED
File without changes
|
src/{bot.py β srf_bot.py}
RENAMED
File without changes
|
qdrant_manager.py β src/utils/qdrant_manager.py
RENAMED
@@ -8,11 +8,11 @@ from langchain_openai import OpenAIEmbeddings
|
|
8 |
from qdrant_client import QdrantClient
|
9 |
from qdrant_client.models import Distance, VectorParams
|
10 |
|
11 |
-
|
12 |
|
13 |
# Qdrant Collections Params
|
14 |
|
15 |
-
openai_embeddings = OpenAIEmbeddings(model=
|
16 |
QDRANT_COLLECTIONS_PARAMS = {'openai_large_chunks_1500char': {'collection_name': 'openai_large_chunks_1500char',
|
17 |
'embeddings_model_name': 'text-embedding-3-large',
|
18 |
'vector_size': 3072,
|
@@ -42,8 +42,8 @@ class QdrantManager:
|
|
42 |
):
|
43 |
self.collection_name = collection_name
|
44 |
self.embeddings = embeddings or QDRANT_COLLECTIONS_PARAMS[collection_name]['embeddings_model']
|
45 |
-
self.url = url or os.getenv("QDRANT_URL")
|
46 |
-
self.api_key = api_key or os.getenv("QDRANT_API_KEY")
|
47 |
self.vector_size = vector_size or QDRANT_COLLECTIONS_PARAMS[collection_name]['vector_size']
|
48 |
self.distance = distance or QDRANT_COLLECTIONS_PARAMS[collection_name]['distance']
|
49 |
|
|
|
8 |
from qdrant_client import QdrantClient
|
9 |
from qdrant_client.models import Distance, VectorParams
|
10 |
|
11 |
+
from config import settings
|
12 |
|
13 |
# Qdrant Collections Params
|
14 |
|
15 |
+
openai_embeddings = OpenAIEmbeddings(model=settings.EMBEDDINGS_MODEL_NAME)
|
16 |
QDRANT_COLLECTIONS_PARAMS = {'openai_large_chunks_1500char': {'collection_name': 'openai_large_chunks_1500char',
|
17 |
'embeddings_model_name': 'text-embedding-3-large',
|
18 |
'vector_size': 3072,
|
|
|
42 |
):
|
43 |
self.collection_name = collection_name
|
44 |
self.embeddings = embeddings or QDRANT_COLLECTIONS_PARAMS[collection_name]['embeddings_model']
|
45 |
+
self.url = url or os.getenv("QDRANT_URL")
|
46 |
+
self.api_key = api_key or os.getenv("QDRANT_API_KEY")
|
47 |
self.vector_size = vector_size or QDRANT_COLLECTIONS_PARAMS[collection_name]['vector_size']
|
48 |
self.distance = distance or QDRANT_COLLECTIONS_PARAMS[collection_name]['distance']
|
49 |
|