import gradio as gr from lib.utils import ask def ask_question(question, history): history = history or [] answer = ask(question) history.append((question, answer)) return history, history demo = gr.Interface(fn=ask_question, title="Ask Lethain a question", description="Ask Lethain a question and get an answer. " "Under the hood is a GPT-3 model trained on Will Larson's blog posts.", inputs=["text", "state"], outputs=["chatbot", "state"], examples=[["What is the best way to manage a team?", []], ["How to organize a team of 20 engineers?", []], ["How to get a job as a engineering executive?", []], ["How to do a complex software migration?", []], ], allow_flagging="never") demo.launch()