• Nicolas Patry's avatar
    Improve QA pipeline error handling (#8286) · 7342d9a5
    Nicolas Patry authored
    - The issue is that with previous code we would have the following:
    
    ```python
    qa_pipeline = (...)
    qa_pipeline(question="Where was he born ?", context="")
    -> IndexError: Dimension out of range (expected to be in range of [-1, 0], but got 1)
    ```
    
    The goal here is to improve this to actually return a ValueError
    wherever possible.
    
    While at it, I tried to simplify QuestionArgumentHandler's code to
    make it smaller and more compat while keeping backward compat.
    7342d9a5
test_pipelines_question_answering.py 6.25 KB