Spaces:
Runtime error
Runtime error
File size: 706 Bytes
639a183 ca316f4 639a183 ca316f4 2a52be5 6f946a8 ca316f4 e613bf4 ca316f4 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
import gradio as gr
message=[{ "role" : "system" , "content" : "You are a helpful and kind AI Assistant." }]
def user_input(input):
if input:
input_message={"role" : "user" , "content" : input}
message.append(input_message)
chat = message
reply=message+'\n'
output_message={"role" : "assistant" , "content" : reply}
message.append(output_message)
return reply
input=gr.inputs.Textbox(lines=7 , label='Chat with AI')
output=gr.outputs.Textbox(label='replay')
interface=gr.Interface(fn=user_input, inputs="text", outputs="text", title="AI Chatbot",
description="Ask anything you want",
theme="compact")
interface.launch() |