AttributeError: 'NoneType' object has no attribute 'decode'
chess-llama: 0 seconds left | Elapsed: 00:00Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/gradio/queueing.py", line 703, in process_events
response = await route_utils.call_process_api(
File "/usr/local/lib/python3.10/site-packages/gradio/route_utils.py", line 323, in call_process_api
output = await app.get_blocks().process_api(
File "/usr/local/lib/python3.10/site-packages/gradio/blocks.py", line 2016, in process_api
result = await self.call_function(
File "/usr/local/lib/python3.10/site-packages/gradio/blocks.py", line 1581, in call_function
prediction = await utils.async_iteration(iterator)
File "/usr/local/lib/python3.10/site-packages/gradio/utils.py", line 691, in async_iteration
return await anext(iterator)
File "/usr/local/lib/python3.10/site-packages/gradio/utils.py", line 685, in anext
return await anyio.to_thread.run_sync(
File "/usr/local/lib/python3.10/site-packages/anyio/to_thread.py", line 56, in run_sync
return await get_async_backend().run_sync_in_worker_thread(
File "/usr/local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 2441, in run_sync_in_worker_thread
return await future
File "/usr/local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 943, in run
result = context.run(func, *args)
File "/usr/local/lib/python3.10/site-packages/gradio/utils.py", line 668, in run_sync_iterator_async
return next(iterator)
File "/usr/local/lib/python3.10/site-packages/gradio/utils.py", line 829, in gen_wrapper
response = next(iterator)
File "/home/user/app/app.py", line 159, in update
guided = generate.regex(current_model, regex_pattern)(prompt)
File "/usr/local/lib/python3.10/functools.py", line 889, in wrapper
return dispatch(args[0].class)(*args, **kw)
File "/usr/local/lib/python3.10/site-packages/outlines/generate/regex.py", line 34, in regex
logits_processor = RegexLogitsProcessor(regex_str, tokenizer=model.tokenizer)
File "/usr/local/lib/python3.10/site-packages/outlines/processors/structured.py", line 152, in init
guide = RegexGuide.from_regex(regex_string, tokenizer)
File "/usr/local/lib/python3.10/site-packages/outlines/fsm/guide.py", line 94, in from_regex
return super().from_regex(
File "/usr/local/lib/python3.10/site-packages/outlines_core/fsm/guide.py", line 226, in from_regex
) = _create_states_mapping(
File "/usr/local/lib/python3.10/site-packages/outlines/caching.py", line 122, in wrapper
result = cached_function(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/outlines/fsm/guide.py", line 78, in cached_create_states_mapping
return uncached_create_states_mapping(regex_string, tokenizer, *args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/outlines_core/fsm/guide.py", line 139, in create_states_mapping
return create_states_mapping_from_fsm(regex_fsm, tokenizer, frozen_tokens)
File "/usr/local/lib/python3.10/site-packages/outlines_core/fsm/guide.py", line 176, in create_states_mapping_from_fsm
states_to_token_maps, empty_token_ids = create_fsm_index_tokenizer(
File "/usr/local/lib/python3.10/site-packages/outlines_core/fsm/regex.py", line 470, in create_fsm_index_tokenizer
tokens_to_token_ids, empty_token_ids = reduced_vocabulary(tokenizer)
File "/usr/local/lib/python3.10/site-packages/outlines_core/fsm/regex.py", line 395, in reduced_vocabulary
token_str: Union[str, Tuple[str, ...]] = tokenizer.convert_token_to_string(
File "/usr/local/lib/python3.10/site-packages/outlines/models/transformers.py", line 99, in convert_token_to_string
string = self.tokenizer.convert_tokens_to_string([token])
File "/usr/local/lib/python3.10/site-packages/transformers/tokenization_utils_fast.py", line 641, in convert_tokens_to_string
return self.backend_tokenizer.decoder.decode(tokens)
AttributeError: 'NoneType' object has no attribute 'decode'