Upload app.py
Browse files
app.py
CHANGED
@@ -108,7 +108,7 @@ async def main():
|
|
108 |
# user_request = "对于文件中的'SepalLengthCm’数据给我一个'直方图',提供图表,并给出分析结果"
|
109 |
#! 可以用设定dpi=300来输出高质量的图表。(注:图的解析度dpi设定为300)
|
110 |
# environ_settings = "【<默认要求> 如果我没有告诉你任何定制化的要求,那么请按照以下的默认要求来回答:1. 你需要用提问的语言来回答(即:如果我用中文提问,你就用中文来回答;我如果用英文提问吗,你就用英文来回答)。2. 如果要求你输出图表,那么图的解析度dpi需要设定为300。图尽量使用seaborn库。seaborn库的参数设定:sns.set(rc={'axes.facecolor':'#FFF9ED','figure.facecolor':'#FFF9ED'}, palette='deep')。】" ## seaborn中的palette参数可以设定图表的颜色,选项包括:deep, muted, pastel, bright, dark, colorblind,Spectral。更多参数可以参考:https://seaborn.pydata.org/generated/seaborn.color_palette.html。
|
111 |
-
environ_settings = "【<默认要求> 如果我没有告诉你任何定制化的要求,那么请按照以下的默认要求来回答:1. 你需要用提问的语言来回答(即:如果我用中文提问,你就用中文来回答;我如果用英文提问吗,你就用英文来回答)。2. 如果要求你输出图表,那么图的大小设定为plt.figure(figsize=(10, 8))。图尽量使用seaborn库。seaborn库的参数设定:sns.set(rc={'axes.facecolor':'#FFF9ED','figure.facecolor':'#FFF9ED'}, palette='deep')
|
112 |
|
113 |
user_request = environ_settings + "\n\n"+ "你需要完成以下任务:\n\n" + prompt
|
114 |
# print('user_request: \n', user_request)
|
@@ -132,7 +132,7 @@ async def main():
|
|
132 |
# st.image(file.get_image() #! working.
|
133 |
# file.show_image()
|
134 |
# st.image(file.get_image(), width=500, output_format='png')
|
135 |
-
st.image(file.get_image(), width=None, output_format='PNG')
|
136 |
|
137 |
|
138 |
# message_placeholder.markdown(full_response + "▌") ## orignal code.
|
@@ -140,8 +140,8 @@ async def main():
|
|
140 |
st.write(full_response)
|
141 |
await session.astop() #! 确认需要关闭。
|
142 |
|
143 |
-
|
144 |
-
|
145 |
|
146 |
|
147 |
|
|
|
108 |
# user_request = "对于文件中的'SepalLengthCm’数据给我一个'直方图',提供图表,并给出分析结果"
|
109 |
#! 可以用设定dpi=300来输出高质量的图表。(注:图的解析度dpi设定为300)
|
110 |
# environ_settings = "【<默认要求> 如果我没有告诉你任何定制化的要求,那么请按照以下的默认要求来回答:1. 你需要用提问的语言来回答(即:如果我用中文提问,你就用中文来回答;我如果用英文提问吗,你就用英文来回答)。2. 如果要求你输出图表,那么图的解析度dpi需要设定为300。图尽量使用seaborn库。seaborn库的参数设定:sns.set(rc={'axes.facecolor':'#FFF9ED','figure.facecolor':'#FFF9ED'}, palette='deep')。】" ## seaborn中的palette参数可以设定图表的颜色,选项包括:deep, muted, pastel, bright, dark, colorblind,Spectral。更多参数可以参考:https://seaborn.pydata.org/generated/seaborn.color_palette.html。
|
111 |
+
environ_settings = "【<默认要求> 如果我没有告诉你任何定制化的要求,那么请按照以下的默认要求来回答:1. 你需要用提问的语言来回答(即:如果我用中文提问,你就用中文来回答;我如果用英文提问吗,你就用英文来回答)。2. 如果要求你输出图表,那么图的大小设定为plt.figure(figsize=(10, 8))。图尽量使用seaborn库。seaborn库的参数设定:sns.set(rc={'axes.facecolor':'#FFF9ED','figure.facecolor':'#FFF9ED'}, palette='deep')。图表上的文字语言使用文件中的原始文字语言(如中文或者英文)】" ## seaborn中的palette参数可以设定图表的颜色,选项包括:deep, muted, pastel, bright, dark, colorblind,Spectral。更多参数可以参考:https://seaborn.pydata.org/generated/seaborn.color_palette.html。
|
112 |
|
113 |
user_request = environ_settings + "\n\n"+ "你需要完成以下任务:\n\n" + prompt
|
114 |
# print('user_request: \n', user_request)
|
|
|
132 |
# st.image(file.get_image() #! working.
|
133 |
# file.show_image()
|
134 |
# st.image(file.get_image(), width=500, output_format='png')
|
135 |
+
st.image(file.get_image(), width=None, output_format='PNG') #* 注意这里的设定,可以提高图片的精细程度。
|
136 |
|
137 |
|
138 |
# message_placeholder.markdown(full_response + "▌") ## orignal code.
|
|
|
140 |
st.write(full_response)
|
141 |
await session.astop() #! 确认需要关闭。
|
142 |
|
143 |
+
st.session_state.messages.append(
|
144 |
+
{"role": "assistant", "content": full_response})
|
145 |
|
146 |
|
147 |
|