CISCai commited on
Commit
335ca60
1 Parent(s): c7320b2

Check if token non-selection was triggered

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -1249,7 +1249,7 @@ Any framework based on `llama-cpp-python` will let you select which chat templat
1249
  choice: int,
1250
  indices: list[int],
1251
  ):
1252
- if choice < 0 or choice >= len(indices) or (token := indices[choice]) < 0:
1253
  raise gr.Error('Token not found')
1254
 
1255
  return {
 
1249
  choice: int,
1250
  indices: list[int],
1251
  ):
1252
+ if choice is None or choice < 0 or choice >= len(indices) or (token := indices[choice]) < 0:
1253
  raise gr.Error('Token not found')
1254
 
1255
  return {