fix textbox removal issue & implement authentication

This commit is contained in:
Alihan
2023-05-19 04:01:10 +03:00
parent 88723c9a3c
commit cee736599a

View File

@@ -6,6 +6,7 @@ import gradio as gr
from loguru import logger
from brain.brain_openai import CloudChatBrain
from settings.config import settings
def brain_commander(prompt, history):
@@ -31,7 +32,9 @@ with gr.Blocks(title="drone commander", analytics_enabled=False) as webui:
placeholder="Enter flight command and press enter",
interactive=True)\
.style(container=True)
prompt.submit(brain_commander, [prompt, state], [chatbot_ui, state])
prompt.submit(brain_commander, [prompt, state], [chatbot_ui, state], queue=False)
prompt.submit(lambda x: gr.update(value=""), [state], [prompt], queue=False)
webui.launch(server_name="0.0.0.0", server_port=8890, debug=True)
#webui.queue(concurrency_count=5)
webui.launch(server_name="0.0.0.0", server_port=8890, debug=False, auth=(settings.USERNAME, settings.PASSW))