badgids / OpenKlyde

An AI Discord bot that connects to a koboldcpp instance by API calls. Have a more intelligent Clyde Bot of your own making!
GNU General Public License v3.0
23 stars 9 forks source link

Bot won't answer. #8

Open sosiska123331827255 opened 1 year ago

sosiska123331827255 commented 1 year ago

image

When a prompt is entered in Discord, the bot.py file generates the following error.

Maybe seeing it in text format will help better... C:\Users\User>python "C:\Users\User\Desktop\OpenKlyde-main\bot.py" [2023-09-03 15:59:53] [INFO ] discord.client: logging in using static token [2023-09-03 15:59:53] [INFO ] discord.gateway: Shard ID None has connected to Gateway (Session ID: ec8941b72865d1786f03b7c65b57549a). Discord Bot is up and running. [2023-09-03 15:59:55] [ERROR ] discord.client: Ignoring exception in on_ready Traceback (most recent call last): File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 441, in _run_event await coro(*args, **kwargs) File "C:\Users\User\Desktop\OpenKlyde-main\bot.py", line 257, in on_ready api_check = await functions.api_status_check(text_api["address"] + text_api["model"], headers=text_api["headers"]) KeyError: 'address' [2023-09-03 16:00:19] [ERROR ] discord.client: Ignoring exception in on_message Traceback (most recent call last): File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 441, in _run_event await coro(*args, **kwargs) File "C:\Users\User\Desktop\OpenKlyde-main\bot.py", line 280, in on_message await update_status() File "C:\Users\User\Desktop\OpenKlyde-main\bot.py", line 49, in update_status data = await functions.check_bot_temps() File "C:\Users\User\Desktop\OpenKlyde-main\functions.py", line 15, in check_bot_temps return output.decode() UnicodeDecodeError: 'utf-8' codec can't decode byte 0x88 in position 39: invalid start byte [2023-09-03 16:07:55] [ERROR ] discord.client: Ignoring exception in on_message Traceback (most recent call last): File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 441, in _run_event await coro(*args, **kwargs) File "C:\Users\User\Desktop\OpenKlyde-main\bot.py", line 280, in on_message await update_status() File "C:\Users\User\Desktop\OpenKlyde-main\bot.py", line 49, in update_status data = await functions.check_bot_temps() File "C:\Users\User\Desktop\OpenKlyde-main\functions.py", line 15, in check_bot_temps return output.decode() UnicodeDecodeError: 'utf-8' codec can't decode byte 0x88 in position 39: invalid start byte [2023-09-03 16:07:56] [ERROR ] discord.client: Ignoring exception in on_message Traceback (most recent call last): File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 441, in _run_event await coro(*args, **kwargs) File "C:\Users\User\Desktop\OpenKlyde-main\bot.py", line 280, in on_message await update_status() File "C:\Users\User\Desktop\OpenKlyde-main\bot.py", line 49, in update_status data = await functions.check_bot_temps() File "C:\Users\User\Desktop\OpenKlyde-main\functions.py", line 15, in check_bot_temps return output.decode() UnicodeDecodeError: 'utf-8' codec can't decode byte 0x88 in position 39: invalid start byte [2023-09-03 16:07:57] [ERROR ] discord.client: Ignoring exception in on_message Traceback (most recent call last): File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 441, in _run_event await coro(*args, **kwargs) File "C:\Users\User\Desktop\OpenKlyde-main\bot.py", line 280, in on_message await update_status() File "C:\Users\User\Desktop\OpenKlyde-main\bot.py", line 49, in update_status data = await functions.check_bot_temps() File "C:\Users\User\Desktop\OpenKlyde-main\functions.py", line 15, in check_bot_temps return output.decode() UnicodeDecodeError: 'utf-8' codec can't decode byte 0x88 in position 39: invalid start byte [2023-09-03 16:10:03] [ERROR ] discord.client: Ignoring exception in on_message Traceback (most recent call last): File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 441, in _run_event await coro(*args, **kwargs) File "C:\Users\User\Desktop\OpenKlyde-main\bot.py", line 280, in on_message await update_status() File "C:\Users\User\Desktop\OpenKlyde-main\bot.py", line 49, in update_status data = await functions.check_bot_temps() File "C:\Users\User\Desktop\OpenKlyde-main\functions.py", line 15, in check_bot_temps return output.decode() UnicodeDecodeError: 'utf-8' codec can't decode byte 0x88 in position 39: invalid start byte [2023-09-03 16:10:04] [ERROR ] discord.client: Ignoring exception in on_message Traceback (most recent call last): File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 441, in _run_event await coro(*args, **kwargs) File "C:\Users\User\Desktop\OpenKlyde-main\bot.py", line 280, in on_message await update_status() File "C:\Users\User\Desktop\OpenKlyde-main\bot.py", line 49, in update_status data = await functions.check_bot_temps() File "C:\Users\User\Desktop\OpenKlyde-main\functions.py", line 15, in check_bot_temps return output.decode() UnicodeDecodeError: 'utf-8' codec can't decode byte 0x88 in position 39: invalid start byte [2023-09-03 16:10:17] [ERROR ] discord.client: Ignoring exception in on_message Traceback (most recent call last): File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 441, in _run_event await coro(*args, **kwargs) File "C:\Users\User\Desktop\OpenKlyde-main\bot.py", line 280, in on_message await update_status() File "C:\Users\User\Desktop\OpenKlyde-main\bot.py", line 49, in update_status data = await functions.check_bot_temps() File "C:\Users\User\Desktop\OpenKlyde-main\functions.py", line 15, in check_bot_temps return output.decode() UnicodeDecodeError: 'utf-8' codec can't decode byte 0x88 in position 39: invalid start byte [2023-09-03 16:10:17] [ERROR ] discord.client: Ignoring exception in on_message Traceback (most recent call last): File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 441, in _run_event await coro(*args, **kwargs) File "C:\Users\User\Desktop\OpenKlyde-main\bot.py", line 280, in on_message await update_status() File "C:\Users\User\Desktop\OpenKlyde-main\bot.py", line 49, in update_status data = await functions.check_bot_temps() File "C:\Users\User\Desktop\OpenKlyde-main\functions.py", line 15, in check_bot_temps return output.decode() UnicodeDecodeError: 'utf-8' codec can't decode byte 0x88 in position 39: invalid start byte [2023-09-03 16:10:53] [ERROR ] discord.client: Ignoring exception in on_message Traceback (most recent call last): File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 441, in _run_event await coro(*args, **kwargs) File "C:\Users\User\Desktop\OpenKlyde-main\bot.py", line 280, in on_message await update_status() File "C:\Users\User\Desktop\OpenKlyde-main\bot.py", line 49, in update_status data = await functions.check_bot_temps() File "C:\Users\User\Desktop\OpenKlyde-main\functions.py", line 15, in check_bot_temps return output.decode() UnicodeDecodeError: 'utf-8' codec can't decode byte 0x88 in position 39: invalid start byte

badgids commented 1 year ago

Hmmm... Do you perhaps have a subfolder named "context"? If not, manually create it and try again and post any errors you may get, please.

sosiska123331827255 commented 1 year ago

image Yes, I did create it.

As I see it, the bot actually turns on, but for some reason, an error occurs after the bot is turned on, not because of something I typed.

image

Same error everytime I turn it on.

badgids commented 1 year ago

Try renaming "context" with a lowercase "c". It places your querry in a text file there and then parses it. My first quess is that file isn't being created, so nothing is being sent, throwing the utf-8 error.

I noticed you've had one hell of a time getting any LLM Discord bot working. So let's do a little troubleshooting.

Make sure you edited any text file with a real text editor like VSCode, Notepad, Notepad++, etc. not any RTF type text editor.

If you're using KoboldAI your port number in "OpenKlyde\configurations\text-default.json" needs to read port 5000, if using Koboldcpp it needs to be port 5001. If "localhost" doesn't work on your system, try changong it to:

"address": "http://0.0.0.0:5001/api/v1/",

or

"address": "http://127.0.0.1:5001/api/v1/",

If you have koboldcpp running on a different machine, and/or a different port than the default, you wil need to change this line to match the correct IP address and port number.

The bot expects koboldcpp to already be running, and a model loaded.

badgids commented 1 year ago

Other than that, if that's not the problem, my next suspicion would be the font you are using doesn't contain the emoji's used on line 231 and 232 in bot.py. Those emoji's just react to the comment to notify the user it's beeing processed, or has been processed. If your fon't doesn't have those emoji's, it could possibly throw a UTF-8 error. You could edit those emoji to something your font has. To edit an emoji you press the "windows key" and ";" or ".".

Let me know if any of ths helps, fixes it, makes it worse, breaks everything, spirarals the world powers into WWIII, etc.

badgids commented 1 year ago

What's your local? I hardcoded utf-8 because I'm apparently an arrogant American. lol.

badgids commented 1 year ago

Oh... wait a minute... Your local... lol. Your Username, does it contain non ascii characters, perhaps? I noticed a few in your screenshots. ;) let's try this.... At the top of bot.py, and any other file that's giving you issues, try adding:

# -*- coding: utf-8 -*-

That SHOULD force it to use utf-8 encoding. I honestly have no way to test it out myself.

badgids commented 1 year ago

Line 348 of "bot.by" declares the encoding, you could try changing this too.

badgids commented 1 year ago

also make sure PyTorch in a directory that has a path with ascii-characters only. I think this may be the issue you are having with all the bots you have tried so far. PyTorch, and several other libraries expect UTF-8 formated file directories.

sosiska123331827255 commented 1 year ago

Make sure you edited any text file with a real text editor like VSCode, Notepad, Notepad++, etc. not any RTF type text editor.

I am editing the file with Notepad++.

If you're using KoboldAI your port number in "OpenKlyde\configurations\text-default.json" needs to read port 5000, if using Koboldcpp it needs to be port 5001.

I am using "coboldcpp". The localhost is working. image

Let me know if any of ths helps, fixes it, makes it worse, breaks everything, spirarals the world powers into WWIII, etc

lol. Koboldcpp started threatening to take over the world, and kill all my family. Is this normal? By the way, image Changing emojis didn't really help. Adding # -*- coding: utf-8 -*- didn't help.

Oh... wait a minute... Your local... lol. Your Username, does it contain non ascii characters, perhaps? I noticed a few in your screenshots. ;)

Non-ascii characters? Sounds alien. What are those?

  • Check line 348 of "bot.py" to declare the encoding and adjust it if necessary.
  • Ensure that PyTorch is installed in a directory with a path containing only ASCII characters, as some libraries like PyTorch expect UTF-8 formatted file directories.

Have no idea what I might need to do in those 2, or how to do either of those. I have no programming experience.

sosiska123331827255 commented 1 year ago

jez i am an idiot. I thought you meant at beginning of every program file, not script...

sosiska123331827255 commented 1 year ago

Well... image image image

Still gives me an error. image