mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-06-26 22:00:13 +00:00
test: export HF_TOKEN
env var in e2e environment (#9551)
* try to fix e2e tests for private NER models * explanatory comment * extend skipif condition
This commit is contained in:
parent
85e8493f4f
commit
bcaef53cbc
4
.github/workflows/e2e.yml
vendored
4
.github/workflows/e2e.yml
vendored
@ -18,7 +18,9 @@ env:
|
||||
PYTHON_VERSION: "3.9"
|
||||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||||
HATCH_VERSION: "1.14.1"
|
||||
HF_API_TOKEN: ${{ secrets.HUGGINGFACE_API_KEY }}
|
||||
# we use HF_TOKEN instead of HF_API_TOKEN to work around a Hugging Face bug
|
||||
# see https://github.com/deepset-ai/haystack/issues/9552
|
||||
HF_TOKEN: ${{ secrets.HUGGINGFACE_API_KEY }}
|
||||
|
||||
jobs:
|
||||
run:
|
||||
|
@ -68,8 +68,8 @@ def test_ner_extractor_hf_backend(raw_texts, hf_annotations, batch_size):
|
||||
|
||||
@pytest.mark.parametrize("batch_size", [1, 3])
|
||||
@pytest.mark.skipif(
|
||||
not os.environ.get("HF_API_TOKEN", None),
|
||||
reason="Export an env var called HF_API_TOKEN containing the Hugging Face token to run this test.",
|
||||
not os.environ.get("HF_API_TOKEN", None) and not os.environ.get("HF_TOKEN", None),
|
||||
reason="Export an env var called HF_API_TOKEN or HF_TOKEN containing the Hugging Face token to run this test.",
|
||||
)
|
||||
def test_ner_extractor_hf_backend_private_models(raw_texts, hf_annotations, batch_size):
|
||||
extractor = NamedEntityExtractor(backend=NamedEntityExtractorBackend.HUGGING_FACE, model="deepset/bert-base-NER")
|
||||
|
Loading…
x
Reference in New Issue
Block a user