HelenaXH commited on
Commit
6492b16
·
verified ·
1 Parent(s): 2eb0f8f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -9
app.py CHANGED
@@ -423,16 +423,17 @@ def predict(message, history):
423
  # ======================== 先处理基础问题 =========================
424
  if 0 < current_q_index <= len(questions):
425
  key = questions[current_q_index - 1][0]
426
- # 第一个问题决定是 / 否
 
427
  if key == "mode" and current_q_index == 1:
428
- ans = message.strip()
429
- user_profile["mode"] = ans
430
- if "是" in ans:
431
- in_backward_flow = True
432
- else:
433
- in_forward_flow = True
434
- else:
435
- user_profile[key] = message.strip()
436
 
437
  if current_q_index < len(questions)and not in_forward_flow and not in_backward_flow:
438
  nxt = questions[current_q_index][1]
 
423
  # ======================== 先处理基础问题 =========================
424
  if 0 < current_q_index <= len(questions):
425
  key = questions[current_q_index - 1][0]
426
+
427
+
428
  if key == "mode" and current_q_index == 1:
429
+ ans = message.strip()
430
+ user_profile["mode"] = ans
431
+ questions[:] = [] # 清空基础问答流程
432
+ if "是" in ans:
433
+ in_backward_flow = True
434
+ else:
435
+ in_forward_flow = True
436
+
437
 
438
  if current_q_index < len(questions)and not in_forward_flow and not in_backward_flow:
439
  nxt = questions[current_q_index][1]