allinaigc commited on
Commit
6034c71
·
1 Parent(s): 6ea8274

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -14
app.py CHANGED
@@ -106,23 +106,11 @@ async def main():
106
 
107
  # user_request = "对于文件中的'SepalLengthCm’数据给我一个'直方图',提供图表,并给出分析结果"
108
  #! 可以用设定dpi=300来输出高质量的图表。(注:图的解析度dpi设定为300)
109
- 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。
110
 
111
  user_request = environ_settings + "\n\n"+ "你需要完成以下任务:\n\n" + prompt
112
  # print('user_request: \n', user_request)
113
 
114
- # files = [
115
- # # File.from_path("examples/assets/iris.csv"),
116
- # # File.from_path("/Users/yunshi/Downloads/360Data/Data Center/Working-On Task/演讲与培训/2023ChatGPT/ChatGPT讲课要点 copy.txt"),
117
- # # File.from_path("/Users/yunshi/Downloads/360Data/文档/cars.csv"),
118
- # # File.from_path("/Users/yunshi/Downloads/360Data/PhD Program/SAS邓祖新/SAS(邓祖新)/sasdata/sasdata/mydir/sasxls.xls"),
119
- # # File.from_path("/Users/yunshi/Downloads/360Data/Data Center/Working-On Task/演讲与培训/2023ChatGPT/Coding/code_interpreter/rawdata/时间频数统计.xlsx"),
120
- # # File.from_path("/Users/yunshi/Downloads/360Data/Data Center/Working-On Task/演讲与培训/2023ChatGPT/Coding/code_interpreter/rawdata/文献相关数据.xls"),
121
- # File.from_path(
122
- # "/Users/yunshi/Downloads/360Data/Data Center/Working-On Task/演讲与培训/2023ChatGPT/Coding/code_interpreter/codeinterpreter-api-main/examples/assets/iris.csv"),
123
- # ] # user_request = "对于文件中的【SepalLengthCm SepalWidthCm】数据,进行【IsolationForest】的异常值分析。你需要展示分析图表,并给出分析结果。最后,你要给出异常点的原始数据,"
124
-
125
-
126
  ### 加载上传的文件,主要路径在上面代码中。
127
  files = [File.from_path(str(uploaded_file_path))]
128
 
@@ -139,7 +127,8 @@ async def main():
139
  # for file in response.files:
140
  for i, file in enumerate(response.files):
141
  # await file.asave(f"/Users/yunshi/Downloads/360Data/Data Center/Working-On Task/演讲与培训/2023ChatGPT/Coding/code_interpreter/output{i}.png") ##working.
142
- st.image(file.get_image()) #! working.
 
143
 
144
 
145
  # message_placeholder.markdown(full_response + "▌") ## orignal code.
 
106
 
107
  # user_request = "对于文件中的'SepalLengthCm’数据给我一个'直方图',提供图表,并给出分析结果"
108
  #! 可以用设定dpi=300来输出高质量的图表。(注:图的解析度dpi设定为300)
109
+ 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。
110
 
111
  user_request = environ_settings + "\n\n"+ "你需要完成以下任务:\n\n" + prompt
112
  # print('user_request: \n', user_request)
113
 
 
 
 
 
 
 
 
 
 
 
 
 
114
  ### 加载上传的文件,主要路径在上面代码中。
115
  files = [File.from_path(str(uploaded_file_path))]
116
 
 
127
  # for file in response.files:
128
  for i, file in enumerate(response.files):
129
  # await file.asave(f"/Users/yunshi/Downloads/360Data/Data Center/Working-On Task/演讲与培训/2023ChatGPT/Coding/code_interpreter/output{i}.png") ##working.
130
+ # st.image(file.get_image() #! working.
131
+ st.image(file.get_image(), width=500) #! working.
132
 
133
 
134
  # message_placeholder.markdown(full_response + "▌") ## orignal code.