text-generation-webui icon indicating copy to clipboard operation
text-generation-webui copied to clipboard

TypeError: expected string or bytes-like object in modules\html_generator.py", line 45, in convert_to_markdown

Open DaveScream opened this issue 1 year ago • 1 comments

Describe the bug

TypeError: expected string or bytes-like object in modules\html_generator.py", line 45, in convert_to_markdown

Is there an existing issue for this?

  • [X] I have searched the existing issues

Reproduction

On some questions AI do not give answer.

Screenshot

No response

Logs

`Traceback (most recent call last):
  File "C:\LLMs\oobabooga_windows\installer_files\env\lib\site-packages\gradio\routes.py", line 395, in run_predict
    output = await app.get_blocks().process_api(
  File "C:\LLMs\oobabooga_windows\installer_files\env\lib\site-packages\gradio\blocks.py", line 1193, in process_api    result = await self.call_function(
  File "C:\LLMs\oobabooga_windows\installer_files\env\lib\site-packages\gradio\blocks.py", line 930, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "C:\LLMs\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:\LLMs\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:\LLMs\oobabooga_windows\installer_files\env\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "C:\LLMs\oobabooga_windows\installer_files\env\lib\site-packages\gradio\utils.py", line 491, in async_iteration
    return next(iterator)
  File "C:\LLMs\oobabooga_windows\text-generation-webui\modules\chat.py", line 248, in cai_chatbot_wrapper
    yield chat_html_wrapper(history, state['name1'], state['name2'], state['mode'])
  File "C:\LLMs\oobabooga_windows\text-generation-webui\modules\html_generator.py", line 259, in chat_html_wrapper
    return generate_chat_html(history, name1, name2)
  File "C:\LLMs\oobabooga_windows\text-generation-webui\modules\html_generator.py", line 226, in generate_chat_html
    row = [convert_to_markdown(entry) for entry in _row]
  File "C:\LLMs\oobabooga_windows\text-generation-webui\modules\html_generator.py", line 226, in <listcomp>
    row = [convert_to_markdown(entry) for entry in _row]
  File "C:\LLMs\oobabooga_windows\text-generation-webui\modules\html_generator.py", line 45, in convert_to_markdown
    string = pattern.sub(replace_blockquote, string)
TypeError: expected string or bytes-like object`

System Info

Windows 10 running native
RTX 3060 12gb
wizard-vicuna-13B-GPTQ-4bit

DaveScream avatar May 06 '23 20:05 DaveScream

Same here :( If there is an action in the json, I get the same error in chat mode.

mykeehu avatar May 10 '23 10:05 mykeehu

I get the same in instruct mode. I start the story and I get the error (Pygmalion Metharme 4bit Topscore model):

Traceback (most recent call last):
  File "J:\oobabooga_windows\installer_files\env\lib\site-packages\gradio\routes.py", line 414, in run_predict
    output = await app.get_blocks().process_api(
  File "J:\oobabooga_windows\installer_files\env\lib\site-packages\gradio\blocks.py", line 1323, in process_api
    result = await self.call_function(
  File "J:\oobabooga_windows\installer_files\env\lib\site-packages\gradio\blocks.py", line 1067, in call_function
    prediction = await utils.async_iteration(iterator)
  File "J:\oobabooga_windows\installer_files\env\lib\site-packages\gradio\utils.py", line 339, in async_iteration
    return await iterator.__anext__()
  File "J:\oobabooga_windows\installer_files\env\lib\site-packages\gradio\utils.py", line 332, in __anext__
    return await anyio.to_thread.run_sync(
  File "J:\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 "J:\oobabooga_windows\installer_files\env\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
  File "J:\oobabooga_windows\installer_files\env\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "J:\oobabooga_windows\installer_files\env\lib\site-packages\gradio\utils.py", line 315, in run_sync_iterator_async
    return next(iterator)
  File "J:\oobabooga_windows\text-generation-webui\modules\chat.py", line 308, in generate_chat_reply_wrapper
    yield chat_html_wrapper(history, state['name1'], state['name2'], state['mode'], state['chat_style'])
  File "J:\oobabooga_windows\text-generation-webui\modules\html_generator.py", line 275, in chat_html_wrapper
    return generate_instruct_html(history)
  File "J:\oobabooga_windows\text-generation-webui\modules\html_generator.py", line 161, in generate_instruct_html
    row = [convert_to_markdown(entry) for entry in _row]
  File "J:\oobabooga_windows\text-generation-webui\modules\html_generator.py", line 161, in <listcomp>
    row = [convert_to_markdown(entry) for entry in _row]
  File "J:\oobabooga_windows\text-generation-webui\modules\html_generator.py", line 48, in convert_to_markdown
    string = pattern.sub(replace_blockquote, string)
TypeError: expected string or bytes-like object

mykeehu avatar May 18 '23 19:05 mykeehu

This issue has been closed due to inactivity for 6 weeks. If you believe it is still relevant, please leave a comment below. You can tag a developer in your comment.

github-actions[bot] avatar Aug 22 '23 23:08 github-actions[bot]