mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-12 12:37:55 +00:00
[improvement](chat) fix filter_condition size ==0 error in python service and update version to '0.8.0-SNAPSHOT' (#437)
This commit is contained in:
@@ -68,7 +68,7 @@ def query_chroma_collection(collection:Collection, query_texts:List[str]=None, q
|
||||
outer_opt = '$and'
|
||||
inner_opt = '$eq'
|
||||
|
||||
if filter_condition is not None:
|
||||
if filter_condition is not None and len(filter_condition) > 0:
|
||||
if len(filter_condition)==1:
|
||||
outer_filter = filter_condition
|
||||
else:
|
||||
@@ -79,10 +79,8 @@ def query_chroma_collection(collection:Collection, query_texts:List[str]=None, q
|
||||
|
||||
logger.info('outer_filter: {}'.format(outer_filter))
|
||||
|
||||
res = collection.query(query_texts=query_texts, query_embeddings=query_embeddings,
|
||||
return collection.query(query_texts=query_texts, query_embeddings=query_embeddings,
|
||||
n_results=n_results, where=outer_filter)
|
||||
return res
|
||||
|
||||
|
||||
def parse_retrieval_chroma_collection_query(res:List[Mapping[str, Any]]):
|
||||
parsed_res = [[] for _ in range(0, len(res['ids']))]
|
||||
|
||||
2
pom.xml
2
pom.xml
@@ -63,7 +63,7 @@
|
||||
<xk.time.version>3.2.4</xk.time.version>
|
||||
<mockito-inline.version>4.5.1</mockito-inline.version>
|
||||
<jsqlparser.version>4.5</jsqlparser.version>
|
||||
<revision>0.7.6-SNAPSHOT</revision>
|
||||
<revision>0.8.0-SNAPSHOT</revision>
|
||||
<!-- Do not bump spotless plugin version since 2.30.0 is the latest version supports Java 8-->
|
||||
<maven.plugin.spotless.version>2.30.0</maven.plugin.spotless.version>
|
||||
<spotless.python.includes></spotless.python.includes>
|
||||
|
||||
Reference in New Issue
Block a user