Problem when starting web UI, when I I want to type or chat, it only shows the assistant as "Typing"

#33
by Alphafi - opened

Loading vicuna-13b-GPTQ-4bit-128g...
Found the following quantized model: models\vicuna-13b-GPTQ-4bit-128g\vicuna-13b-4bit-128g.safetensors
Loading model ...
Done.
Traceback (most recent call last):
File "C:\AI\Text\oobabooga-windows\installer_files\env\lib\site-packages\gradio\routes.py", line 393, in run_predict
output = await app.get_blocks().process_api(
File "C:\AI\Text\oobabooga-windows\installer_files\env\lib\site-packages\gradio\blocks.py", line 1108, in process_api
result = await self.call_function(
File "C:\AI\Text\oobabooga-windows\installer_files\env\lib\site-packages\gradio\blocks.py", line 929, in call_function prediction = await anyio.to_thread.run_sync(
File "C:\AI\Text\oobabooga-windows\installer_files\env\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "C:\AI\Text\oobabooga-windows\installer_files\env\lib\site-packages\anyio_backends_asyncio.py", line 937, in run_sync_in_worker_thread
return await future
File "C:\AI\Text\oobabooga-windows\installer_files\env\lib\site-packages\anyio_backends_asyncio.py", line 867, in run
result = context.run(func, *args)
File "C:\AI\Text\oobabooga-windows\installer_files\env\lib\site-packages\gradio\utils.py", line 490, in async_iteration
return next(iterator)
File "C:\AI\Text\oobabooga-windows\text-generation-webui\modules\chat.py", line 228, in cai_chatbot_wrapper
for history in chatbot_wrapper(text, state):
File "C:\AI\Text\oobabooga-windows\text-generation-webui\modules\chat.py", line 160, in chatbot_wrapper
for reply in generate_reply(f"{prompt}{' ' if len(cumulative_reply) > 0 else ''}{cumulative_reply}", state, eos_token=eos_token, stopping_strings=stopping_strings):
File "C:\AI\Text\oobabooga-windows\text-generation-webui\modules\text_generation.py", line 181, in generate_reply
input_ids = encode(question, add_bos_token=state['add_bos_token'], truncation_length=get_max_prompt_length(state))
File "C:\AI\Text\oobabooga-windows\text-generation-webui\modules\text_generation.py", line 31, in encode
input_ids = shared.tokenizer.encode(str(prompt), return_tensors='pt', add_special_tokens=add_special_tokens)
AttributeError: 'NoneType' object has no attribute 'encode'

Same error here...

ChatGPT4 say: This error indicates that there is an issue with the code, specifically with the 'tokenizer' object. The error is caused by the 'tokenizer' object being 'NoneType', which means it has not been initialized or assigned a value before trying to use it.

The error occurs in the following line of code:

input_ids = shared.tokenizer.encode(str(prompt), return_tensors='pt', add_special_tokens=add_special_tokens)

To resolve this error, ensure that the 'tokenizer' object has been properly initialized before calling the 'encode' method. Check if the tokenizer was imported correctly and if it was assigned an appropriate value in the code. You may also look for where the 'tokenizer' object should have been initialized in the code and ensure it has been done correctly.

Sign up or log in to comment