run-llama / llama-hub

A library of data loaders for LLMs made by the community -- to be used with LlamaIndex and/or LangChain
https://llamahub.ai/
MIT License
3.42k stars 727 forks source link

Fuzzy citation bugfix #925

Open vvi56 opened 5 months ago

vvi56 commented 5 months ago

Description

This PR fixes out of range error in fuzzy_citation pack that happens in case there are more than one response sentences.

Exception has occurred: IndexError
list index out of range

  File ".../python3.11/site-packages/llama_hub/llama_packs/fuzzy_citation/base.py", line 68, in get_relevant_sentences
    top_chunks[response_sent_idx][-1] += top_sentences[
        ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^

Type of Change

Please delete options that are not relevant.

How Has This Been Tested?

Tested with demo fuzzy_citation notebook.

Suggested Checklist:

vvi56 commented 5 months ago

@logan-markewich , please take a look