Liyonghui commited on
Commit
5387022
1 Parent(s): d84855e

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -155,7 +155,7 @@ Spark_url = "ws://spark-api.xf-yun.com/v1.1/chat" # v1.5环境的地址
155
  # Spark_url = "ws://spark-api.xf-yun.com/v2.1/chat" # v2.0环境的地址
156
 
157
 
158
- #text = []
159
 
160
 
161
  # length = 0
@@ -183,7 +183,7 @@ def checklen(text):
183
  return text
184
 
185
  def getanswerByXunFei(t):
186
- text.clear
187
  question = checklen(getText("user", t))
188
  ans = ""
189
  main(appid, api_key, api_secret, Spark_url, domain, question)
@@ -198,7 +198,6 @@ if 'past' not in st.session_state:
198
  st.session_state['past'] = []
199
  user_input=st.text_input("请输入您的问题:",key='input')
200
  if user_input:
201
- #text.clear()
202
  output=getanswerByXunFei(user_input)
203
  st.session_state['past'].append(user_input)
204
  st.session_state['generated'].append(output)
 
155
  # Spark_url = "ws://spark-api.xf-yun.com/v2.1/chat" # v2.0环境的地址
156
 
157
 
158
+ text = []
159
 
160
 
161
  # length = 0
 
183
  return text
184
 
185
  def getanswerByXunFei(t):
186
+ text.clear()
187
  question = checklen(getText("user", t))
188
  ans = ""
189
  main(appid, api_key, api_secret, Spark_url, domain, question)
 
198
  st.session_state['past'] = []
199
  user_input=st.text_input("请输入您的问题:",key='input')
200
  if user_input:
 
201
  output=getanswerByXunFei(user_input)
202
  st.session_state['past'].append(user_input)
203
  st.session_state['generated'].append(output)