mirror of
https://github.com/gradio-app/gradio.git
synced 2024-11-27 01:40:20 +08:00
e6cda90b69
* 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
12 lines
363 B
Python
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)
|