File size: 603 Bytes
e641e34 f48d575 7b88d99 e641e34 f3af7d2 cd7f54a 292ff41 5b6bdce efdc6c0 f3af7d2 292ff41 f3af7d2 5b6bdce cd7f54a e641e34 cd7f54a 292ff41 e641e34 |
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 |
import gradio as gr
from chatterbot import ChatBot
from chatterbot.trainers import ListTrainer
#from chatterbot.trainers import ChatterBotCorpusTrainer
chatbot = ChatBot("Chatpot",storage_adapter='chatterbot.storage.SQLStorageAdapter',database_uri = 'sqlite:///database.sqlite3')
file1 = open("dialogs.txt", "r")
training_data = file1.read().splitlines()
#trainer = ListTrainer(chatbot)
#trainer.train(training_data)
print(training_data)
def greet(name):
text = chatbot.get_response(name)
return str(text)
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
iface.launch() |