MindVR commited on
Commit
5cbcb86
·
verified ·
1 Parent(s): c0eccc2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -27,10 +27,10 @@ def build_prompt(history, new_message):
27
  return prompt
28
 
29
  def chat(history, new_message):
30
- # Nếu history là chuỗi (do nhập tay trên UI), thì parse sang list
31
  if isinstance(history, str):
 
32
  try:
33
- import ast
34
  history = ast.literal_eval(history)
35
  except:
36
  history = [history]
 
27
  return prompt
28
 
29
  def chat(history, new_message):
30
+ # Đảm bảo history là list (khi nhập trực tiếp trên UI đôi khi str)
31
  if isinstance(history, str):
32
+ import ast
33
  try:
 
34
  history = ast.literal_eval(history)
35
  except:
36
  history = [history]