2
0
mirror of https://github.com/gradio-app/gradio.git synced 2025-04-24 13:01:18 +08:00

Accelerate-Tests

- speed up a test with a smaller model
- add torch to reqs
This commit is contained in:
Ömer Faruk Özdemir 2022-02-09 10:24:30 +03:00
parent 4d9e3f4cda
commit 7619ae76d1
3 changed files with 6 additions and 3 deletions

@ -15,3 +15,4 @@ pytest-cov
black
isort
flake8
torch

@ -398,6 +398,8 @@ tomli==2.0.0
# black
# coverage
# pytest
torch==1.10.2
# via -r requirements.in
tqdm==4.62.3
# via
# huggingface-hub
@ -415,6 +417,7 @@ typing-extensions==4.0.1
# black
# huggingface-hub
# tensorflow
# torch
urllib3[secure]==1.26.8
# via
# dulwich

@ -244,10 +244,9 @@ class TestLoadInterface(unittest.TestCase):
class TestLoadFromPipeline(unittest.TestCase):
def test_question_answering(self):
pipe = transformers.pipeline(model="lysandre/tiny-vit-random")
pipe = transformers.pipeline(model="sshleifer/bart-tiny-random")
output = pipe(
"My name is Sylvain and I work at Hugging Face in Brooklyn",
"Where do I work?",
"My name is Sylvain and I work at Hugging Face in Brooklyn"
)
self.assertIsNotNone(output)