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

AttributeError: 'function' object has no attribute '__wrapped__'

Open varkappadev opened this issue 11 months ago • 2 comments

Describe the bug

A recent re-building of my container image no longer appears to work. When entering text in chat-instruct or instruct mode I get: AttributeError: 'function' object has no attribute 'wrapped'

Due to the way containers are built and the way the build cache works, I cannot exactly say when this would have started but my best guess is within the last 8 weeks.

I disabled all session features except long_replies, listen, and verbose and applied and restarted the server when testing.

I couldn't find the same bug but it is possible it is related to some of the other gradio-related bugs.

Is there an existing issue for this?

  • [X] I have searched the existing issues

Reproduction

Start the server (I use CPU-only mode), load a model (I tried various models but a for reproduction a Transformers-based one with the Alpaca template should suffice, switch to chat-instruct or instruct, enter some text, click Generate and the error shows in the log.

Screenshot

No response

Logs

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/gradio/queueing.py", line 407, in call_prediction
    output = await route_utils.call_process_api(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/gradio/route_utils.py", line 226, in call_process_api
    output = await app.get_blocks().process_api(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/gradio/blocks.py", line 1550, in process_api
    result = await self.call_function(
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/gradio/blocks.py", line 1199, in call_function
    prediction = await utils.async_iteration(iterator)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/gradio/utils.py", line 519, in async_iteration
    return await iterator.__anext__()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/gradio/utils.py", line 512, in __anext__
    return await anyio.to_thread.run_sync(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/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.12/site-packages/anyio/_backends/_asyncio.py", line 2144, in run_sync_in_worker_thread
    return await future
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 851, in run
    result = context.run(func, *args)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/gradio/utils.py", line 495, in run_sync_iterator_async
    return next(iterator)
           ^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/gradio/utils.py", line 649, in gen_wrapper
    yield from f(*args, **kwargs)
  File "/app/modules/chat.py", line 413, in generate_chat_reply_wrapper
    yield chat_html_wrapper(history, state['name1'], state['name2'], state['mode'], state['chat_style'], state['character_menu']), history
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/modules/html_generator.py", line 322, in chat_html_wrapper
    return generate_cai_chat_html(history['visible'], name1, name2, style, character, reset_cache)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/modules/html_generator.py", line 246, in generate_cai_chat_html
    row = [convert_to_markdown_wrapped(entry, use_cache=i != len(history) - 1) for entry in _row]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/modules/html_generator.py", line 112, in convert_to_markdown_wrapped
    return convert_to_markdown.__wrapped__(string)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'function' object has no attribute '__wrapped__'

System Info

CPU-only containerized installation

varkappadev avatar Mar 19 '24 21:03 varkappadev

Well, I was getting this error due to an outdated plugin, namely the CodeRunner plugin.

Alkohole avatar Mar 20 '24 14:03 Alkohole

confirming same error, no extensions installed.

KnowhereFern avatar Apr 29 '24 00:04 KnowhereFern