mirror of https://github.com/langgenius/dify.git
fix multimodal embedding retrival test
This commit is contained in:
parent
901cc64ac9
commit
676063890c
|
|
@ -473,9 +473,7 @@ class RetrievalService:
|
||||||
for segment in segments:
|
for segment in segments:
|
||||||
child_chunks: list[ChildChunk] = child_chunk_map.get(segment.id, [])
|
child_chunks: list[ChildChunk] = child_chunk_map.get(segment.id, [])
|
||||||
attachment_infos: list[dict[str, Any]] = attachment_map.get(segment.id, [])
|
attachment_infos: list[dict[str, Any]] = attachment_map.get(segment.id, [])
|
||||||
ds_dataset_document: DatasetDocument | None = valid_dataset_documents.get(
|
ds_dataset_document: DatasetDocument | None = valid_dataset_documents.get(segment.document_id)
|
||||||
segment.document_id
|
|
||||||
)
|
|
||||||
|
|
||||||
if ds_dataset_document and ds_dataset_document.doc_form == IndexStructureType.PARENT_CHILD_INDEX:
|
if ds_dataset_document and ds_dataset_document.doc_form == IndexStructureType.PARENT_CHILD_INDEX:
|
||||||
if segment.id not in include_segment_ids:
|
if segment.id not in include_segment_ids:
|
||||||
|
|
@ -495,7 +493,9 @@ class RetrievalService:
|
||||||
max_score = max(max_score, document.metadata.get("score", 0.0) if document else 0.0)
|
max_score = max(max_score, document.metadata.get("score", 0.0) if document else 0.0)
|
||||||
for attachment_info in attachment_infos:
|
for attachment_info in attachment_infos:
|
||||||
file_document = doc_to_document_map[attachment_info["id"]]
|
file_document = doc_to_document_map[attachment_info["id"]]
|
||||||
max_score = max(max_score, file_document.metadata.get("score", 0.0) if file_document else 0.0)
|
max_score = max(
|
||||||
|
max_score, file_document.metadata.get("score", 0.0) if file_document else 0.0
|
||||||
|
)
|
||||||
|
|
||||||
map_detail = {
|
map_detail = {
|
||||||
"max_score": max_score,
|
"max_score": max_score,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue