Spaces:
Runtime error
Runtime error
File size: 761 Bytes
639a183 ca316f4 639a183 ca316f4 a4dd53c ca316f4 16e6f2f 6f946a8 a4dd53c 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 23 24 25 26 |
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)
message.append('/n')
chat = message
reply=message
output_message={"role" : "assistant" , "content" : reply}
message.append(output_message)
message.append('\n')
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() |