mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-08-24 02:53:24 +00:00
fix: lint
This commit is contained in:
parent
bbaed67440
commit
4d5ca993f1
@ -207,7 +207,7 @@ def post_process_code(code):
|
|||||||
def get_chat_mode(selected, param=None) -> ChatScene:
|
def get_chat_mode(selected, param=None) -> ChatScene:
|
||||||
if chat_mode_title["chat_use_plugin"] == selected:
|
if chat_mode_title["chat_use_plugin"] == selected:
|
||||||
return ChatScene.ChatExecution
|
return ChatScene.ChatExecution
|
||||||
elif chat_mode_title["sql_generate_diagnostics"] == selected:
|
elif chat_mode_title["sql_generate_diagnostics"] == selected:
|
||||||
sql_mode = param
|
sql_mode = param
|
||||||
if sql_mode == conversation_sql_mode["auto_execute_ai_response"]:
|
if sql_mode == conversation_sql_mode["auto_execute_ai_response"]:
|
||||||
return ChatScene.ChatWithDbExecute
|
return ChatScene.ChatWithDbExecute
|
||||||
@ -225,7 +225,6 @@ def get_chat_mode(selected, param=None) -> ChatScene:
|
|||||||
return ChatScene.ChatNormal
|
return ChatScene.ChatNormal
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def chatbot_callback(state, message):
|
def chatbot_callback(state, message):
|
||||||
print(f"chatbot_callback:{message}")
|
print(f"chatbot_callback:{message}")
|
||||||
state.messages[-1][-1] = f"{message}"
|
state.messages[-1][-1] = f"{message}"
|
||||||
@ -406,7 +405,6 @@ def build_single_model_ui():
|
|||||||
tabs.select(on_select, None, selected)
|
tabs.select(on_select, None, selected)
|
||||||
|
|
||||||
with tabs:
|
with tabs:
|
||||||
|
|
||||||
tab_qa = gr.TabItem(get_lang_text("knowledge_qa"), elem_id="QA")
|
tab_qa = gr.TabItem(get_lang_text("knowledge_qa"), elem_id="QA")
|
||||||
with tab_qa:
|
with tab_qa:
|
||||||
mode = gr.Radio(
|
mode = gr.Radio(
|
||||||
@ -521,7 +519,6 @@ def build_single_model_ui():
|
|||||||
)
|
)
|
||||||
plugin_selector.select(plugin_change, None, plugin_selected)
|
plugin_selector.select(plugin_change, None, plugin_selected)
|
||||||
|
|
||||||
|
|
||||||
with gr.Blocks():
|
with gr.Blocks():
|
||||||
chatbot = grChatbot(elem_id="chatbot", visible=False).style(height=550)
|
chatbot = grChatbot(elem_id="chatbot", visible=False).style(height=550)
|
||||||
with gr.Row():
|
with gr.Row():
|
||||||
@ -652,12 +649,12 @@ def async_db_summery():
|
|||||||
thread = threading.Thread(target=client.init_db_summary)
|
thread = threading.Thread(target=client.init_db_summary)
|
||||||
thread.start()
|
thread.start()
|
||||||
|
|
||||||
|
|
||||||
def signal_handler(sig, frame):
|
def signal_handler(sig, frame):
|
||||||
print("in order to avoid chroma db atexit problem")
|
print("in order to avoid chroma db atexit problem")
|
||||||
os._exit(0)
|
os._exit(0)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument("--host", type=str, default="0.0.0.0")
|
parser.add_argument("--host", type=str, default="0.0.0.0")
|
||||||
|
Loading…
Reference in New Issue
Block a user