2021-12-14 14:02:19 +08:00
|
|
|
import gradio as gr
|
|
|
|
|
2023-07-01 05:30:04 +08:00
|
|
|
title = "gpt2-xl"
|
2021-12-14 14:02:19 +08:00
|
|
|
|
|
|
|
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%"],
|
|
|
|
]
|
|
|
|
|
2023-03-24 06:33:44 +08:00
|
|
|
demo = gr.load(
|
2023-07-01 05:30:04 +08:00
|
|
|
"huggingface/gpt2-xl",
|
2022-05-04 01:28:57 +08:00
|
|
|
inputs=gr.Textbox(lines=5, max_lines=6, label="Input Text"),
|
2021-12-14 14:02:19 +08:00
|
|
|
title=title,
|
|
|
|
examples=examples,
|
2022-03-29 05:22:49 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
demo.launch()
|