Spaces:
Sleeping
Sleeping
File size: 878 Bytes
1135131 75676dd |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
import gradio as gr
#import os
#os.system("pip install transformers")
#from transformers import pipeline
# #ssl
# import ssl
# ssl._create_default_https_context = ssl._create_unverified_context
def generator_gpt2(text):
return text+"\n???"
def generator_openai_gpt(text):
return text+"\n!!!"
examples=[["Hello, I'm a language model,"],
["How are you?\n"]]
demo1 = gr.Interface(fn=generator_gpt2,
inputs=gr.inputs.Textbox(label="input"),
outputs=gr.outputs.Textbox(label="???"),
)
demo2 = gr.Interface(fn=generator_openai_gpt,
inputs=gr.inputs.Textbox(),
outputs=gr.outputs.Textbox(label="!!!"),
)
demo = gr.Parallel(demo1, demo2,
examples=examples,
allow_flagging="auto",
css='styles.css',
)
demo.launch() |