ceejaytheanalyst commited on
Commit
10dd01c
·
verified ·
1 Parent(s): 4110aa4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -33,6 +33,8 @@ def mapping_code(user_input):
33
  # Sort results by similarity scores
34
  result.sort(key=lambda x: x[2], reverse=True)
35
 
 
 
36
  # Return top 5 entries with 'code', 'description', and 'similarity_score'
37
  top_5_results = []
38
  for i in range(5):
 
33
  # Sort results by similarity scores
34
  result.sort(key=lambda x: x[2], reverse=True)
35
 
36
+ num_results = min(5, len(result))
37
+
38
  # Return top 5 entries with 'code', 'description', and 'similarity_score'
39
  top_5_results = []
40
  for i in range(5):