mirror of
https://github.com/gradio-app/gradio.git
synced 2025-02-23 11:39:17 +08:00
* optional labels * added prop * Added IOComponent class * get component fix * fixed component function * fixed test components * formatting * fixed output tests * working on blocks tests * fixed test blocks * cleanup * merged * unrender * add article * formatting * fixed render() * added demo * formatting * merge main * add interface types * added output only * added input only * formatting * added demos * formatting * removed unnecessary import * updated demos * fixed duplication * fix for state
15 lines
304 B
Python
15 lines
304 B
Python
import gradio as gr
|
|
|
|
component = gr.Textbox(lines=5, label="Text")
|
|
api = gr.Interface.load("huggingface/EleutherAI/gpt-j-6B")
|
|
|
|
demo = gr.Interface(
|
|
fn=lambda x: x[:-50] + api(x[-50:]),
|
|
inputs=component,
|
|
outputs=component,
|
|
title="GPT-J-6B",
|
|
)
|
|
|
|
if __name__ == "__main__":
|
|
demo.launch()
|