diff --git a/.github/workflows/rest_api_tests.yml b/.github/workflows/rest_api_tests.yml index a0b24514b6..53e7462afd 100644 --- a/.github/workflows/rest_api_tests.yml +++ b/.github/workflows/rest_api_tests.yml @@ -112,7 +112,7 @@ jobs: - name: Install REST API run: | pip install -U "./rest_api[dev]" - pip install ".[dev]" + pip install ".[inference,dev]" pip install . - name: Run tests diff --git a/rest_api/rest_api/controller/feedback.py b/rest_api/rest_api/controller/feedback.py index 0f05019384..af8da58e08 100644 --- a/rest_api/rest_api/controller/feedback.py +++ b/rest_api/rest_api/controller/feedback.py @@ -4,7 +4,7 @@ import logging from fastapi import FastAPI, APIRouter -from haystack.schema import Label +from haystack.schema import Label, Span from haystack.document_stores import BaseDocumentStore from rest_api.schema import FilterRequest, CreateLabelSerialized from rest_api.utils import get_app, get_pipelines @@ -113,7 +113,10 @@ def export_feedback( offset_start_in_document = 0 if label.answer and label.answer.offsets_in_document: - offset_start_in_document = label.answer.offsets_in_document[0].start + if isinstance(label.answer.offsets_in_document[0], Span): + offset_start_in_document = label.answer.offsets_in_document[0].start + else: + offset_start_in_document = label.answer.offsets_in_document[0].row if full_document_context: context = label.document.content