Stremly commited on
Commit
88bf1eb
Β·
verified Β·
1 Parent(s): 759fe06

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -12
app.py CHANGED
@@ -46,19 +46,16 @@ def navigate(screenshot, task: str, platform: str, history):
46
 
47
  # ───────────────────── normalise history input ──────────────────────────
48
  messages=None
49
- if history in (None, ""):
50
- history_list = []
 
 
 
 
51
  else:
52
- if isinstance(history, str):
53
- try:
54
- messages= ast.literal_eval(history)
55
- except Exception as exc:
56
- raise ValueError("`history` must be a JSON/Python list: " + str(exc))
57
- else:
58
- messages = history
59
-
60
- if not isinstance(history_list, list):
61
- raise ValueError("`history` must be a list of messages.")
62
 
63
  # ─────────────────────────── model forward ─────────────────────────────
64
  text = processor.apply_chat_template(
 
46
 
47
  # ───────────────────── normalise history input ──────────────────────────
48
  messages=None
49
+
50
+ if isinstance(history, str):
51
+ try:
52
+ messages= ast.literal_eval(history)
53
+ except Exception as exc:
54
+ raise ValueError("`history` must be a JSON/Python list: " + str(exc))
55
  else:
56
+ messages = history
57
+
58
+
 
 
 
 
 
 
 
59
 
60
  # ─────────────────────────── model forward ─────────────────────────────
61
  text = processor.apply_chat_template(