ChatDulun / app.py
drclab's picture
gr.Row
bcd0cea
raw
history blame
No virus
1.02 kB
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</h1>""")
with gr.Row():
name = gr.Textbox(label='Guest Name')
output = gr.Textbox(label='Greetings !')
greet_btn = gr.Button("Greet")
with gr.Accordion("Are we learning?"):
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()