File size: 1,239 Bytes
550c9d4 5264414 e43cd3d ba82af1 ba02b7f 5264414 15cfa8d 550c9d4 e43cd3d 64ded05 e43cd3d 3cdf971 9713329 fa0b6a5 8cbc55f b2157de fa0b6a5 3cdf971 574a2ba 3cdf971 |
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 |
import sys
import os
import openai
import gradio as gr
#from auth import HF_TOKEN
openai.api_key = os.getenv('API_KEY')
default_prompt = 'How to use ChatGPT?'
#gitsys.path.insert(0, '/')
def greet(name):
return "ChatDulun is ChatGPT induced disruption to Higher Education \n" + name + "!!"
# iface = gr.Interface(fn=greet, inputs="text", outputs="text", title='ChatDulun = Higher Education Disrupted',
# css=""" body { background-color: red } .input_text input { background-color: green } """)
with gr.Blocks() as demo:
gr.HTML("""<h1 align="center">ChatDulun is Here to Disrupt Incumbent Workflow in HigherED</h1>""")
with gr.Row().style(equal_height=True):
name = gr.Textbox(label='What You Want ...').style(show_copy_button=True, container=True)
output = gr.Textbox(label='What You Get ...')
greet_btn = gr.Button("==> ChatGPT will complete ==>").style(size='lg')
with gr.Accordion(label = "Are We Learning or Machine Learning ?", open = False):
gr.Markdown("""![Robot](https://drclab-dulun-store.hf.space/img/ml.jpg)""")
greet_btn.click(fn=greet, inputs=name, outputs=output)
demo.title= 'ChatDulun = HigherEd Disrupted'
demo.launch() |