Skip to content

Commit

Permalink
fix: install inference in REST API tests (deepset-ai#5252)
Browse files Browse the repository at this point in the history
* install inference in restapi tests

* add workflow dispatch to test the REST API CI in PR

* trigger ci

* tablecell

* tablecell

* revert ci trigger

* mypy
  • Loading branch information
ZanSara authored Jul 3, 2023
1 parent 1066e95 commit 4b380d8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rest_api_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions rest_api/rest_api/controller/feedback.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4b380d8

Please sign in to comment.