cast42 commited on
Commit
6b61cc9
·
verified ·
1 Parent(s): a0f961c

Changed the order of the results to DESCendent

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -29,7 +29,7 @@ def similarity_search(query: str, k: int = 5):
29
  query=f"""
30
  SELECT *, array_cosine_distance({embedding_column_float}, {embedding}::FLOAT[{embedding_dimensions}]) as distance
31
  FROM {table_name}
32
- ORDER BY distance
33
  LIMIT {k};
34
  """
35
  ).to_df()
 
29
  query=f"""
30
  SELECT *, array_cosine_distance({embedding_column_float}, {embedding}::FLOAT[{embedding_dimensions}]) as distance
31
  FROM {table_name}
32
+ ORDER BY distance DESC
33
  LIMIT {k};
34
  """
35
  ).to_df()