Skip to content

Commit

Permalink
Pipeline should be agnostic (huggingface#12656)
Browse files Browse the repository at this point in the history
  • Loading branch information
LysandreJik committed Jul 12, 2021
1 parent 9b3aab2 commit fd41e2d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/test_pipelines_question_answering.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import unittest

from transformers import is_tf_available, is_torch_available
from transformers.data.processors.squad import SquadExample
from transformers.pipelines import Pipeline, QuestionAnsweringArgumentHandler, pipeline
from transformers.testing_utils import slow
Expand Down Expand Up @@ -57,14 +58,15 @@ def get_pipelines(self):
task=self.pipeline_task,
model=model,
tokenizer=model,
framework="pt",
framework="pt" if is_torch_available() else "tf",
**self.pipeline_loading_kwargs,
)
for model in self.small_models
]
return question_answering_pipelines

@slow
@unittest.skipIf(not is_torch_available() and not is_tf_available(), "Either torch or TF must be installed.")
def test_high_topk_small_context(self):
self.pipeline_running_kwargs.update({"topk": 20})
valid_inputs = [
Expand Down

0 comments on commit fd41e2d

Please sign in to comment.