update webui.py
This commit is contained in:
parent
7d79b676d5
commit
5ce2484af0
2
webui.py
2
webui.py
|
|
@ -26,4 +26,4 @@ if __name__ == "__main__":
|
|||
menu_icon="chat-quote",
|
||||
default_index=0)
|
||||
|
||||
pages[selected_page]["func"]()
|
||||
pages[selected_page]["func"](api)
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@ from streamlit_chatbox import *
|
|||
|
||||
chat_box = ChatBox()
|
||||
|
||||
def dialogue_page():
|
||||
|
||||
def dialogue_page(api: ApiRequest):
|
||||
with st.sidebar:
|
||||
dialogue_mode = st.radio("请选择对话模式",
|
||||
["LLM 对话",
|
||||
|
|
@ -22,7 +23,8 @@ def dialogue_page():
|
|||
if prompt := st.chat_input("请输入对话内容,换行请使用Ctrl+Enter"):
|
||||
chat_box.user_say(prompt)
|
||||
chat_box.ai_say("正在思考...")
|
||||
# with api.chat_fastchat([{"role": "user", "content": "prompt"}], stream=streaming) as r: # todo: support history len
|
||||
# with api.chat_fastchat([{"role": "user", "content": "prompt"}], stream=streaming) as r:
|
||||
# todo: support history len
|
||||
text = ""
|
||||
r = api.chat_chat(prompt, no_remote_api=True)
|
||||
for t in r:
|
||||
|
|
@ -33,4 +35,4 @@ def dialogue_page():
|
|||
# for t in r.iter_text(None):
|
||||
# text += t
|
||||
# chat_box.update_msg(text)
|
||||
# chat_box.update_msg(text, streaming=False)
|
||||
# chat_box.update_msg(text, streaming=False)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import streamlit as st
|
||||
from webui_pages.utils import *
|
||||
|
||||
def knowledge_base_page():
|
||||
def knowledge_base_page(api: ApiRequest):
|
||||
st.write(123)
|
||||
pass
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import streamlit as st
|
||||
from webui_pages.utils import *
|
||||
|
||||
def model_config_page():
|
||||
def model_config_page(api: ApiRequest):
|
||||
pass
|
||||
Loading…
Reference in New Issue