Spaces:
Running
Running
Check if token non-selection was triggered
Browse files
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 {
|