xBelladonna / oobabot

A Discord bot which talks to Large Language Model AIs using just about any API-enabled backend.
MIT License
5 stars 0 forks source link

First time setup with oobabooga difficulties #1

Closed FireWolfVids closed 3 weeks ago

FireWolfVids commented 4 months ago

I just pulled version 0.3.2 for a clean setup and the latest version of oobabooga as well. Bot is up and running with oobabot. I am using the example-config.yml with my discord token, no problems there. Initially, there was an issue with it not being happy with the datetime_format provided, but switching it back to default (blank) solved the problem. After that is where I'm unable to progress.

Using the default oobabooga option for api_type, the generation hangs and oobabooga does not see it. I am using the openai extension on oobabooga since api seems to no longer be supported. Eventually, this error pops up.

←[33;40m2024-07-24 07:23:37,088←[0m←[37;40m ERROR ←[0m←[31;40mException while running <coroutine object DiscordBot._send_text_response_in_channel at 0x00000228DBAE1630>. Response: cannot access local variable 'generator' where it is not associated with a value←[0m Stack (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "C:\Users\Chris\AppData\Local\Programs\Python\Python311\Scripts\oobabot.exe\__main__.py", line 7, in <module> sys.exit(main()) File "C:\Users\Chris\AppData\Local\Programs\Python\Python311\Lib\site-packages\oobabot\oobabot.py", line 268, in main run_cli() File "C:\Users\Chris\AppData\Local\Programs\Python\Python311\Lib\site-packages\oobabot\oobabot.py", line 264, in run_cli oobabot.start() File "C:\Users\Chris\AppData\Local\Programs\Python\Python311\Lib\site-packages\oobabot\oobabot.py", line 100, in start asyncio.run(self.runtime.run()) File "C:\Users\Chris\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 190, in run return runner.run(main) File "C:\Users\Chris\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 118, in run return self._loop.run_until_complete(task) File "C:\Users\Chris\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 641, in run_until_complete self.run_forever() File "C:\Users\Chris\AppData\Local\Programs\Python\Python311\Lib\asyncio\windows_events.py", line 321, in run_forever super().run_forever() File "C:\Users\Chris\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 608, in run_forever self._run_once() File "C:\Users\Chris\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 1936, in _run_once handle._run() File "C:\Users\Chris\AppData\Local\Programs\Python\Python311\Lib\asyncio\events.py", line 84, in _run self._context.run(self._callback, *self._args) File "C:\Users\Chris\AppData\Local\Programs\Python\Python311\Lib\site-packages\oobabot\discord_bot.py", line 413, in process_message_queue await self._handle_response( File "C:\Users\Chris\AppData\Local\Programs\Python\Python311\Lib\site-packages\oobabot\discord_bot.py", line 528, in _handle_response fancy_logger.get().error( Task exception was never retrieved future: <Task finished name='Task-20' coro=<DiscordBot.process_message_queue() done, defined at C:\Users\Chris\AppData\Local\Programs\Python\Python311\Lib\site-packages\oobabot\discord_bot.py:333> exception=UnboundLocalError("cannot access local variable 'generator' where it is not associated with a value")> Traceback (most recent call last): File "C:\Users\Chris\AppData\Local\Programs\Python\Python311\Lib\site-packages\oobabot\discord_bot.py", line 413, in process_message_queue await self._handle_response( File "C:\Users\Chris\AppData\Local\Programs\Python\Python311\Lib\site-packages\oobabot\discord_bot.py", line 534, in _handle_response raise task.exception() File "C:\Users\Chris\AppData\Local\Programs\Python\Python311\Lib\site-packages\oobabot\discord_bot.py", line 769, in _send_text_response_in_channel response, response_stat = await self._generate_response( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Chris\AppData\Local\Programs\Python\Python311\Lib\site-packages\oobabot\discord_bot.py", line 661, in _generate_response return generator, response_stat ^^^^^^^^^ UnboundLocalError: cannot access local variable 'generator' where it is not associated with a value

I figured I might need to use the openai api_type, so I switch to that and received a new error, immediate this time.

←[33;40m2024-07-24 07:37:00,766←[0m←[37;40m DEBUG ←[0m←[36;40mMessage from Chris in channel #moderator-only←[0m ←[33;40m2024-07-24 07:37:07,438←[0m←[37;40m DEBUG ←[0m←[36;40mGenerating prompt...←[0m ←[33;40m2024-07-24 07:37:07,750←[0m←[37;40m ERROR ←[0m←[31;40mException while running <coroutine object DiscordBot._send_text_response_in_channel at 0x0000019753E21EA0>. Response: cannot access local variable 'url' where it is not associated with a value←[0m Stack (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "C:\Users\Chris\AppData\Local\Programs\Python\Python311\Scripts\oobabot.exe\__main__.py", line 7, in <module> sys.exit(main()) File "C:\Users\Chris\AppData\Local\Programs\Python\Python311\Lib\site-packages\oobabot\oobabot.py", line 268, in main run_cli() File "C:\Users\Chris\AppData\Local\Programs\Python\Python311\Lib\site-packages\oobabot\oobabot.py", line 264, in run_cli oobabot.start() File "C:\Users\Chris\AppData\Local\Programs\Python\Python311\Lib\site-packages\oobabot\oobabot.py", line 100, in start asyncio.run(self.runtime.run()) File "C:\Users\Chris\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 190, in run return runner.run(main) File "C:\Users\Chris\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 118, in run return self._loop.run_until_complete(task) File "C:\Users\Chris\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 641, in run_until_complete self.run_forever() File "C:\Users\Chris\AppData\Local\Programs\Python\Python311\Lib\asyncio\windows_events.py", line 321, in run_forever super().run_forever() File "C:\Users\Chris\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 608, in run_forever self._run_once() File "C:\Users\Chris\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 1936, in _run_once handle._run() File "C:\Users\Chris\AppData\Local\Programs\Python\Python311\Lib\asyncio\events.py", line 84, in _run self._context.run(self._callback, *self._args) File "C:\Users\Chris\AppData\Local\Programs\Python\Python311\Lib\site-packages\oobabot\discord_bot.py", line 413, in process_message_queue await self._handle_response( File "C:\Users\Chris\AppData\Local\Programs\Python\Python311\Lib\site-packages\oobabot\discord_bot.py", line 528, in _handle_response fancy_logger.get().error( Task exception was never retrieved future: <Task finished name='Task-38' coro=<DiscordBot.process_message_queue() done, defined at C:\Users\Chris\AppData\Local\Programs\Python\Python311\Lib\site-packages\oobabot\discord_bot.py:333> exception=UnboundLocalError("cannot access local variable 'url' where it is not associated with a value")> Traceback (most recent call last): File "C:\Users\Chris\AppData\Local\Programs\Python\Python311\Lib\site-packages\oobabot\discord_bot.py", line 413, in process_message_queue await self._handle_response( File "C:\Users\Chris\AppData\Local\Programs\Python\Python311\Lib\site-packages\oobabot\discord_bot.py", line 534, in _handle_response raise task.exception() File "C:\Users\Chris\AppData\Local\Programs\Python\Python311\Lib\site-packages\oobabot\discord_bot.py", line 769, in _send_text_response_in_channel response, response_stat = await self._generate_response( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Chris\AppData\Local\Programs\Python\Python311\Lib\site-packages\oobabot\discord_bot.py", line 593, in _generate_response prompt_prefix = await self.prompt_generator.generate( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Chris\AppData\Local\Programs\Python\Python311\Lib\site-packages\oobabot\prompt_generator.py", line 420, in generate message_history_txt = await self._render_history( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Chris\AppData\Local\Programs\Python\Python311\Lib\site-packages\oobabot\prompt_generator.py", line 236, in _render_history prompt_units = await self.ooba_client.get_token_count(prompt_without_history) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Chris\AppData\Local\Programs\Python\Python311\Lib\site-packages\oobabot\ooba_client.py", line 272, in get_token_count url, headers=headers, json=request, verify_ssl=False ^^^ UnboundLocalError: cannot access local variable 'url' where it is not associated with a value

I'd really like to follow along with this fork of the project. Happy to try alternative API options so I can get started.

xBelladonna commented 1 month ago

@FireWolfVids Oh god that's some nasty crap I must have done. Sorry for the absence, things have been thinging and I've been busy, but I'm trying to bring the quality of the code up now with a few updates. Try with the latest version and hopefully it works, let me know and post logs like before and I'll try to get onto it.

FireWolfVids commented 3 weeks ago

Newest version works great!