Skip to content

rag_with_eval.py has a lots old content and cannot run correctly #443

@StoneWillow

Description

@StoneWillow

Bug description

rag_with_eval.py has a lots old content and cannot run correctly, some "import" and "init" is old. I think it is easy to reproduce if you just run it

What version are you seeing the problem on?

main branch

How to reproduce the bug

some "import" and "init" is old. I think it is easy to reproduce if you just run it

Error messages and logs

# Error messages and logs here please
```Error building index: list index out of range, resetting the index

Traceback (most recent call last):

  File "<frozen runpy>", line 198, in _run_module_as_main

  File "<frozen runpy>", line 88, in _run_code

  File "AdalFlow\use_cases\rag\rag_with_eval.py", line 86, in <module>

    rag.prepare_retriever(filter_func=lambda x: x.parent_doc_id in doc_ids)

  File "AdalFlow\use_cases\rag\build\rag.py", line 167, in prepare_retriever

    self.retriever.build_index_from_documents(

  File "Python\Python311\Lib\site-packages\adalflow\components\retriever\faiss_retriever.py", line 195, in build_index_from_documents

    raise e

  File "Python\Python311\Lib\site-packages\adalflow\components\retriever\faiss_retriever.py", line 172, in build_index_from_documents

    documents[0], Sequence

    ~~~~~~~~~^^^

IndexError: list index out of range


### Environment

Windows,

### More info

_No response_

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working, either in /adalflow, /tutorials, or /use cases...

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions