allinaigc commited on
Commit
110b525
·
1 Parent(s): 86680e0

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -29,7 +29,7 @@ openai.api_key = os.environ['user_token']
29
  os.environ["VERBOSE"] = "True" # 可以看到具体的错误?
30
 
31
  # 设置中文字体。
32
- myfont = FontProperties(fname='SimHei.ttf') # NOTE: 注意这里的云服务器路径格式。
33
  # mpl.rcParams['font.family'] = ['myfont']
34
  # sns.set(font='myfont')
35
  # plt.rcParams['font.sans-serif'] = ['myfont']
@@ -144,7 +144,6 @@ async def main():
144
  with st.status('processing...', expanded=True, state='running') as status:
145
 
146
  # generate the response
147
- myfont = FontProperties(fname='SimHei.ttf') # NOTE: 注意这里的云服务器路径格式。
148
 
149
  response = await session.generate_response(
150
  user_request, files=files
@@ -161,7 +160,9 @@ async def main():
161
  # st.image(file.get_image() #! working.
162
  # file.show_image()
163
  # st.image(file.get_image(), width=500, output_format='png')
 
164
  sns.set(font='myfont')
 
165
  # * 注意这里的设定,可以提高图片的精细程度。
166
  st.image(file.get_image(), width=None,
167
  output_format='PNG')
 
29
  os.environ["VERBOSE"] = "True" # 可以看到具体的错误?
30
 
31
  # 设置中文字体。
32
+ # myfont = FontProperties(fname='SimHei.ttf') # NOTE: 注意这里的云服务器路径格式。
33
  # mpl.rcParams['font.family'] = ['myfont']
34
  # sns.set(font='myfont')
35
  # plt.rcParams['font.sans-serif'] = ['myfont']
 
144
  with st.status('processing...', expanded=True, state='running') as status:
145
 
146
  # generate the response
 
147
 
148
  response = await session.generate_response(
149
  user_request, files=files
 
160
  # st.image(file.get_image() #! working.
161
  # file.show_image()
162
  # st.image(file.get_image(), width=500, output_format='png')
163
+ myfont = FontProperties(fname='SimHei.ttf') # NOTE: 注意这里的云服务器路径格式。
164
  sns.set(font='myfont')
165
+ plt.title(fontproperties=myfont)
166
  # * 注意这里的设定,可以提高图片的精细程度。
167
  st.image(file.get_image(), width=None,
168
  output_format='PNG')