kobai-sdk 0.2.8rc10__py3-none-any.whl → 0.2.8rc11__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of kobai-sdk might be problematic. Click here for more details.
- kobai/ai_rag.py +8 -3
- kobai/tenant_client.py +1 -1
- {kobai_sdk-0.2.8rc10.dist-info → kobai_sdk-0.2.8rc11.dist-info}/METADATA +1 -1
- {kobai_sdk-0.2.8rc10.dist-info → kobai_sdk-0.2.8rc11.dist-info}/RECORD +7 -7
- {kobai_sdk-0.2.8rc10.dist-info → kobai_sdk-0.2.8rc11.dist-info}/LICENSE +0 -0
- {kobai_sdk-0.2.8rc10.dist-info → kobai_sdk-0.2.8rc11.dist-info}/WHEEL +0 -0
- {kobai_sdk-0.2.8rc10.dist-info → kobai_sdk-0.2.8rc11.dist-info}/top_level.txt +0 -0
kobai/ai_rag.py
CHANGED
|
@@ -143,7 +143,7 @@ def __generate_sentences_from_questions(tc: AIContext, debug):
|
|
|
143
143
|
ss.sql(full_sql)
|
|
144
144
|
|
|
145
145
|
|
|
146
|
-
def encode_to_delta_local(tc: AIContext, st_model: SentenceTransformer, replica_schema=None):
|
|
146
|
+
def encode_to_delta_local(tc: AIContext, st_model: Union[SentenceTransformer, Embeddings], replica_schema=None):
|
|
147
147
|
"""
|
|
148
148
|
Encode Semantic Data to Vectors in Delta Table
|
|
149
149
|
|
|
@@ -172,8 +172,13 @@ def encode_to_delta_local(tc: AIContext, st_model: SentenceTransformer, replica_
|
|
|
172
172
|
content_list = [r["content"] for r in sentences_df.collect()]
|
|
173
173
|
id_list = [r["id"] for r in sentences_df.collect()]
|
|
174
174
|
|
|
175
|
-
|
|
176
|
-
|
|
175
|
+
if isinstance(st_model, SentenceTransformer):
|
|
176
|
+
vector_list = st_model.encode(
|
|
177
|
+
content_list, normalize_embeddings=True, show_progress_bar=True)
|
|
178
|
+
else:
|
|
179
|
+
vector_list = st_model.embed_documents(content_list)
|
|
180
|
+
#vector_list = st_model.encode(
|
|
181
|
+
# content_list, normalize_embeddings=True, show_progress_bar=True)
|
|
177
182
|
|
|
178
183
|
schema_v = StructType([
|
|
179
184
|
StructField("id", IntegerType(), True),
|
kobai/tenant_client.py
CHANGED
|
@@ -451,7 +451,7 @@ class TenantClient:
|
|
|
451
451
|
"""
|
|
452
452
|
ai_rag.generate_sentences(self.get_ai_context(), replica_schema=replica_schema, concept_white_list=concept_white_list, use_questions=use_questions, debug=debug)
|
|
453
453
|
|
|
454
|
-
def rag_encode_to_delta_local(self, st_model: SentenceTransformer, replica_schema=None):
|
|
454
|
+
def rag_encode_to_delta_local(self, st_model: Union[SentenceTransformer, Embeddings], replica_schema=None):
|
|
455
455
|
"""
|
|
456
456
|
Encode Semantic Data to Vectors in Delta Table
|
|
457
457
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
kobai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
kobai/ai_query.py,sha256=d0WOPKtQ-bI_zW3-_6guEJX0t55OcxdXIdgXaD-zKK0,9413
|
|
3
|
-
kobai/ai_rag.py,sha256=
|
|
3
|
+
kobai/ai_rag.py,sha256=Gqj_CF2lLjMc0CcxquOAgXhiuY6pKwyJumR2NK7QdOo,14559
|
|
4
4
|
kobai/databricks_client.py,sha256=fyqqMly2Qm0r1AHWsQjkYeNsDdH0G1JSgTkF9KJ55qA,2118
|
|
5
5
|
kobai/demo_tenant_client.py,sha256=wlNc-bdI2wotRXo8ppUOalv4hYdBlek_WzJNARZV-AE,9293
|
|
6
6
|
kobai/spark_client.py,sha256=opM_F-4Ut5Hq5zZjWMuLvUps9sDULvyPNZHXGL8dW1k,776
|
|
7
7
|
kobai/tenant_api.py,sha256=9U6UbxpaAb-kpbuADXx3kbkNKaOzYy0I-GGwbpiCCOk,4212
|
|
8
|
-
kobai/tenant_client.py,sha256=
|
|
9
|
-
kobai_sdk-0.2.
|
|
10
|
-
kobai_sdk-0.2.
|
|
11
|
-
kobai_sdk-0.2.
|
|
12
|
-
kobai_sdk-0.2.
|
|
13
|
-
kobai_sdk-0.2.
|
|
8
|
+
kobai/tenant_client.py,sha256=ktw75dmmX95gD6qIkG-mAmdo48RkF96SgmpRmfDWblo,39422
|
|
9
|
+
kobai_sdk-0.2.8rc11.dist-info/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
|
|
10
|
+
kobai_sdk-0.2.8rc11.dist-info/METADATA,sha256=jyrtCYbqTYKrHMHBOmWUrDfkK3NFqtqxmQyTW-vZ05A,19205
|
|
11
|
+
kobai_sdk-0.2.8rc11.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
12
|
+
kobai_sdk-0.2.8rc11.dist-info/top_level.txt,sha256=ns1El3BrTTHKvoAgU1XtiSaVIudYeCXbEEUVY8HFDZ4,6
|
|
13
|
+
kobai_sdk-0.2.8rc11.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|