Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| #def update( text, choice): | |
| # if (choice==“gpt2large“): | |
| # return f1(text) | |
| # return f"Welcome to Gradio, {name}!" | |
| generator1 = gr.Interface.load("huggingface/gpt2-large") | |
| generator2 = gr.Interface.load("huggingface/EleutherAI/gpt-neo-2.7B") | |
| generator3 = gr.Interface.load("huggingface/EleutherAI/gpt-j-6B") | |
| demo = gr.Blocks() | |
| def f1(x): | |
| return generator1(x) | |
| def f2(x): | |
| return generator2(x) | |
| def f3(x): | |
| return generator3(x) | |
| with demo: | |
| gr.Markdown( | |
| """ | |
| # Hello World! | |
| Start typing below to see the output. | |
| """) | |
| inp = gr.Textbox(placeholder="Enter a statement to complete") | |
| out1 = gr.Textbox() | |
| out2 = gr.Textbox() | |
| out3 = gr.Textbox() | |
| inp.change(fn=f1, | |
| inputs=inp, | |
| outputs=out1) | |
| out1.change(fn=f2, | |
| inputs=inp, | |
| outputs=out2) | |
| out2.change(fn=f3, | |
| inputs=inp, | |
| outputs=out3) | |
| demo.launch() |