Skip to content

Commit

Permalink
fix on retrieval when key_term length is zero
Browse files Browse the repository at this point in the history
The following error is solved:

    if core_text[x].lower() == key_term[0].lower():
IndexError: string index out of range
  • Loading branch information
ucekmez authored Mar 1, 2024
1 parent 729f36b commit 4f6a7b5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions llmware/retrieval.py
Original file line number Diff line number Diff line change
Expand Up @@ -1374,6 +1374,9 @@ def locate_query_match (self, query, core_text):
for x in range(0, len(core_text)):
match = 0
for key_term in query_tokens:
if len(key_term) == 0:
continue

if key_term.startswith('"'):
key_term = key_term[1:-1]

Expand Down

0 comments on commit 4f6a7b5

Please sign in to comment.