xNul / chat-llama-discord-bot

A Discord Bot for chatting with LLaMA, Vicuna, Alpaca, MPT, or any other Large Language Model (LLM) supported by text-generation-webui or llama.cpp.
https://discord.gg/TcRGDV754Y
MIT License
118 stars 23 forks source link

TypeError: chatbot_wrapper() got an unexpected keyword argument 'generate_state' #7

Closed sfxworks closed 1 year ago

sfxworks commented 1 year ago

Just did a run on the latest branch. First time using it. Added my token.

Traceback (most recent call last):
  File "/home/sam/.local/lib/python3.10/site-packages/discord/app_commands/commands.py", line 842, in _do_call
    return await self._callback(interaction, params)  # type: ignore
  File "/home/sam/git/text-generation-webui/bot.py", line 203, in reply
    await llm_gen(ctx, queues)
  File "/home/sam/git/text-generation-webui/bot.py", line 124, in llm_gen
    for resp in chatbot_wrapper(user_input):
TypeError: chatbot_wrapper() got an unexpected keyword argument 'generate_state'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/sam/.local/lib/python3.10/site-packages/discord/ext/commands/hybrid.py", line 438, in _invoke_with_namespace
    value = await self._do_call(ctx, ctx.kwargs)  # type: ignore
  File "/home/sam/.local/lib/python3.10/site-packages/discord/app_commands/commands.py", line 856, in _do_call
    raise CommandInvokeError(self, e) from e
discord.app_commands.errors.CommandInvokeError: Command 'reply' raised an exception: TypeError: chatbot_wrapper() got an unexpected keyword argument 'generate_state'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/sam/.local/lib/python3.10/site-packages/discord/ext/commands/hybrid.py", line 438, in _invoke_with_namespace
    value = await self._do_call(ctx, ctx.kwargs)  # type: ignore
  File "/home/sam/.local/lib/python3.10/site-packages/discord/app_commands/commands.py", line 856, in _do_call
    raise CommandInvokeError(self, e) from e
discord.ext.commands.errors.HybridCommandError: Hybrid command raised an error: Command 'reply' raised an exception: TypeError: chatbot_wrapper() got an unexpected keyword argument 'generate_state' 
sfxworks commented 1 year ago

Looks like this commit is the one that broke it https://github.com/oobabooga/text-generation-webui/commit/a453d4e9c4c9ab76f3de138d3cc311c7b5ac261d

xNul commented 1 year ago

Ahh this is like the fourth time he's broken the API in the last week. I'll fix it, thanks for reporting

xNul commented 1 year ago

@sfxworks it doesn't look like anything was broken. I'm able to run the latest commit with np. I think you're using the updated version of bot.py without the updated version of text-generation-webui. Try running git pull and pip install -r requirements.txt --upgrade in the text-generation-webui folder.

sfxworks commented 1 year ago

@sfxworks it doesn't look like anything was broken. I'm able to run the latest commit with np. I think you're using the updated version of bot.py without the updated version of text-generation-webui. Try running git pull and pip install -r requirements.txt --upgrade in the text-generation-webui folder.

It was the opposite. I revered the webui to before that commit and it worked.

xNul commented 1 year ago

@sfxworks it doesn't look like anything was broken. I'm able to run the latest commit with np. I think you're using the updated version of bot.py without the updated version of text-generation-webui. Try running git pull and pip install -r requirements.txt --upgrade in the text-generation-webui folder.

It was the opposite. I revered the webui to before that commit and it worked.

I'm not able to reproduce this. I just reinstalled everything once again to confirm and it worked perfectly. Please reinstall and it should work for you.

sfxworks commented 1 year ago

Now it works. Strange. Somewhere between the commits caused my issue. Closing for now.