NLP_Chatbot / app.py
DanielIglesias97's picture
We have improved the interface of the application and removed the
8991658
raw
history blame contribute delete
803 Bytes
from chatbot import ChatBotManager
import gradio as gr
class Gradio_App():
def __init__(self):
self.server_name = "0.0.0.0"
self.server_port = 7860
self.chatbot_manager = ChatBotManager()
def build_ui(self):
with gr.Blocks() as self.demo:
dropdown = gr.Dropdown(self.chatbot_manager.get_available_model_types(), label='Model type')
chat_iface = gr.ChatInterface(self.chatbot_manager.obtain_answer, \
additional_inputs=[dropdown], \
type="messages")
def run(self):
self.demo.launch(server_name=self.server_name, server_port=self.server_port)
def main():
gradio_app = Gradio_App()
gradio_app.build_ui()
gradio_app.run()
main()