gradio/test/test_pipelines.py
Abubakar Abid e6cda90b69
Refactoring external.py (#2579)
* pass token & add typing

* updated docstring

* reorg

* improve docs

* test for private space

* changelog

* changed asserts

* pipelines

* streamline

* formatting

* int

* dataclass

* formatting

* annotations

* formatting

* external test fixes

* formatting

* typing

* addressing review

* fix tests

* dataframedata

* refactoring

* removed unused imports

* added better error message for invalid spaces

* removed unnecessary import
2022-11-01 09:14:15 -07:00

12 lines
363 B
Python

import transformers
import gradio as gr
class TestLoadFromPipeline:
def test_text_to_text_model_from_pipeline(self):
pipe = transformers.pipeline(model="sshleifer/bart-tiny-random")
io = gr.Interface.from_pipeline(pipe)
output = io("My name is Sylvain and I work at Hugging Face in Brooklyn")
assert isinstance(output, str)