Commit 0f28eb4a authored by zhengyaoqiu's avatar zhengyaoqiu

优化

parent df87bb1c
......@@ -23,7 +23,16 @@ class ImageSearch:
images = [hit.entity.get("image") for hit in results[0]]
scores = [hit.score for hit in results[0]]
return list(zip(keys, images, scores))
result = [
{
"key": key,
"image": image,
"score": score
}
for key, image, score in zip(keys, images, scores)
]
return result
except Exception as e:
self.__logger.error(f"Image search failed: {e}")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment