Spaces:
Sleeping
Sleeping
| 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() |