mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-21 02:19:59 +08:00
38b16beb16
* Switch model and fix demo * fix remaining demos --------- Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
15 lines
281 B
Python
15 lines
281 B
Python
import gradio as gr
|
|
|
|
component = gr.Textbox(lines=5, label="Text")
|
|
api = gr.load("huggingface/gpt2-xl")
|
|
|
|
demo = gr.Interface(
|
|
fn=lambda x: x[:-50] + api(x[-50:]),
|
|
inputs=component,
|
|
outputs=component,
|
|
title="gpt2-xl",
|
|
)
|
|
|
|
if __name__ == "__main__":
|
|
demo.launch()
|