innightwolfsleep / text-generation-webui-telegram_bot

LLM telegram bot
MIT License
106 stars 20 forks source link

No longer works on latest Oogabooga #191

Closed OliviaOliveiira closed 11 months ago

OliviaOliveiira commented 11 months ago

I've updated my oogabooga to the latest version, and now the bot no longer works. File "C:\My_Bots\Text_gen\text-generation-webui\extensions\telegram_bot\source\generator.py", line 34, in init generator_class = getattr(importlib.import_module("source.generators." + script), "Generator") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\My_Bots\Text_gen\text-generation-webui\installer_files\env\Lib\importlib__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1204, in _gcd_import File "", line 1176, in _find_and_load File "", line 1126, in _find_and_load_unlocked File "", line 241, in _call_with_frames_removed File "", line 1204, in _gcd_import File "", line 1176, in _find_and_load File "", line 1126, in _find_and_load_unlocked File "", line 241, in _call_with_frames_removed File "", line 1204, in _gcd_import File "", line 1176, in _find_and_load File "", line 1140, in _find_and_load_unlocked ModuleNotFoundError: No module named 'source'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\My_Bots\Text_gen\text-generation-webui\installer_files\env\Lib\threading.py", line 1038, in _bootstrap_inner self.run() File "C:\My_Bots\Text_gen\text-generation-webui\installer_files\env\Lib\threading.py", line 975, in run self._target(*self._args, **self._kwargs) File "C:\My_Bots\Text_gen\text-generation-webui\extensions\telegram_bot\script.py", line 19, in run_server tg_server = AiogramLlmBot(config_file_path=config_file_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\My_Bots\Text_gen\text-generation-webui\extensions\telegram_bot\main.py", line 73, in init tp.generator.init( File "C:\My_Bots\Text_gen\text-generation-webui\extensions\telegram_bot\source\generator.py", line 37, in init importlib.import_module("extensions.telegram_bot.source.generators." + script), "Generator" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\My_Bots\Text_gen\text-generation-webui\installer_files\env\Lib\importlib__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1204, in _gcd_import File "", line 1176, in _find_and_load File "", line 1147, in _find_and_load_unlocked File "", line 690, in _load_unlocked File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "C:\My_Bots\Text_gen\text-generation-webui\extensions\telegram_bot\source\generators\generator_text_generator_webui.py", line 3, in import server File "C:\My_Bots\Text_gen\text-generation-webui\server.py", line 67, in signal.signal(signal.SIGINT, signal_handler) File "C:\My_Bots\Text_gen\text-generation-webui\installer_files\env\Lib\signal.py", line 56, in signal handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: signal only works in main thread of the main interpreter

innightwolfsleep commented 11 months ago

I'll check it.

Curently, you can try to set --api on Oogabooga and set "generator generator_text_generator_webui_api" in bot config.

OliviaOliveiira commented 11 months ago

Well, it did start the extension and the buttons started working, however, no messages received. \ in cmd

innightwolfsleep commented 11 months ago

Old generators for Oogabooga outdated or broken... Added new generator connecting to new api (open_api) as main. #192

Direct request to text_generator is broken, seems because of modules conflict. Cant fix it right now, but open_api shold be enought (I hope so).