diff --git a/README.md b/README.md index 9a0c5c3..6599d81 100644 --- a/README.md +++ b/README.md @@ -157,5 +157,5 @@ python -m streamlit run ./星火大模型.py --theme.base dark --server.port 850 运行命令: ``` -python -m streamlit run ./Yi-34B-Chat.py --theme.base dark --server.port 8501 +python -m streamlit run ./Yi_34B_Chat.py --theme.base dark --server.port 8501 ``` \ No newline at end of file diff --git a/模型API - 智谱 - ChatGLM Turbo/ChatGLM_Turbo.py b/模型API - 智谱 - ChatGLM Turbo/ChatGLM_Turbo.py index 6295efe..40bc3cf 100644 --- a/模型API - 智谱 - ChatGLM Turbo/ChatGLM_Turbo.py +++ b/模型API - 智谱 - ChatGLM Turbo/ChatGLM_Turbo.py @@ -23,8 +23,12 @@ zhipuai.api_key = " " with st.sidebar: with st.expander('参数', expanded=True): - top_p = st.slider('top_p', 0.01, 1.0, value=0.7, step=0.01) - temperature = st.slider('temperature', 0.01, 1.0, value=0.95, step=0.01) + top_p = st.slider('top_p', 0.01, 1.0, value=0.7, step=0.01, key='top_p_session') + temperature = st.slider('temperature', 0.01, 1.0, value=0.95, step=0.01, key='temperature_session') + def reset_parameter(): + st.session_state['top_p_session'] = 0.7 + st.session_state['temperature_session'] = 0.95 + reset_parameter_button = st.button('重置', on_click=reset_parameter) def chatglm_chat(prompt=[]): response = zhipuai.model_api.sse_invoke( diff --git a/模型API - 百度 - 零一万物的开源模型 Yi-34B-Chat/Yi-34B-Chat.py b/模型API - 百度 - 零一万物的开源模型 Yi_34B_Chat/Yi_34B_Chat.py similarity index 100% rename from 模型API - 百度 - 零一万物的开源模型 Yi-34B-Chat/Yi-34B-Chat.py rename to 模型API - 百度 - 零一万物的开源模型 Yi_34B_Chat/Yi_34B_Chat.py diff --git a/模型API - 讯飞 - 星火大模型/星火大模型.py b/模型API - 讯飞 - 星火大模型/星火大模型.py index d601273..a3c30f6 100644 --- a/模型API - 讯飞 - 星火大模型/星火大模型.py +++ b/模型API - 讯飞 - 星火大模型/星火大模型.py @@ -26,8 +26,12 @@ with st.sidebar: st.write('当前模型:'+API_model_0) with st.expander('参数', expanded=True): - top_k = st.slider('top_k', 1, 6, value=4, step=1) - temperature = st.slider('temperature', 0.01, 1.0, value=0.5, step=0.01) + top_k = st.slider('top_k', 1, 6, value=4, step=1, key='top_k_session') + temperature = st.slider('temperature', 0.01, 1.0, value=0.5, step=0.01, key='temperature_session') + def reset_parameter(): + st.session_state['top_k_session'] = 4 + st.session_state['temperature_session'] = 0.5 + reset_parameter_button = st.button('重置', on_click=reset_parameter) # 云端环境的服务地址 if API_model == '讯飞 - 星火大模型 V1.5':