gradio/demo/gpt_j/run.py
pngwn e34210ccda
max_lines + autoheight for textbox (#1153)
* ensure autoheight always reruns when value changes

* implement lines + max_lines for textbox

* update demo

* fix test
2022-05-03 18:28:57 +01:00

20 lines
441 B
Python

import gradio as gr
title = "GPT-J-6B"
examples = [
["The tower is 324 metres (1,063 ft) tall,"],
["The Moon's orbit around Earth has"],
["The smooth Borealis basin in the Northern Hemisphere covers 40%"],
]
demo = gr.Interface.load(
"huggingface/EleutherAI/gpt-j-6B",
inputs=gr.Textbox(lines=5, max_lines=6, label="Input Text"),
title=title,
examples=examples,
)
if __name__ == "__main__":
demo.launch()