Commit fd672a79 authored by bluelovers's avatar bluelovers

fix: remove cmp

by ChatGPT
parent 04924241
...@@ -129,7 +129,7 @@ class EmbeddingDatabase: ...@@ -129,7 +129,7 @@ class EmbeddingDatabase:
if first_id not in self.ids_lookup: if first_id not in self.ids_lookup:
self.ids_lookup[first_id] = [] self.ids_lookup[first_id] = []
self.ids_lookup[first_id] = sorted(self.ids_lookup[first_id] + [(ids, embedding)], key=lambda x: len(x[0]), reverse=True, cmp=lambda x, y: x.lower() > y.lower()) self.ids_lookup[first_id] = sorted(self.ids_lookup[first_id] + [(ids, embedding)], key=lambda x: (len(x[0]), x[0].casefold()), reverse=True)
return embedding return embedding
......
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