FartyPants / Playground

Text WebUI extension to add clever Notebooks to Chat mode
133 stars 8 forks source link

Import Error #4

Open SeattleUser0 opened 1 year ago

SeattleUser0 commented 1 year ago

I followed the installation instructions exactly with the exception of modifying the webui.py file to add the --extension flag as you can now just check a box for the desired extension in the GUI. The Playground extension fails to load, giving this output:

2023-08-24 09:27:51 ERROR:Failed to load the extension "Playground". Traceback (most recent call last): File "C:\Users\User0\Documents\AI\oobabooga_windows\text-generation-webui\modules\extensions.py", line 35, in load_extensions exec(f"import extensions.{name}.script") File "<string>", line 1, in <module> File "C:\Users\User0\Documents\AI\oobabooga_windows\text-generation-webui\extensions\Playground\script.py", line 18, in <module> from peft.tuners.lora import mark_only_lora_as_trainable ImportError: cannot import name 'mark_only_lora_as_trainable' from 'peft.tuners.lora' (C:\Users\User0\Documents\AI\oobabooga_windows\installer_files\env\lib\site-packages\peft\tuners\lora.py)

And indeed, when I check lora.py, there isn't a method with that name. The closest is _mark_only_adapters_as_trainable.

Visual Studio Code said that the import 'mark_only_lora_as_trainable' wasn't used, so I deleted it from script.py and now it seems to work okay.

photogbill commented 1 year ago

add the extension to the CMD_FLAGS file instead, they changed how they do that on the webui end.

SeattleUser0 commented 1 year ago

I deleted and reinstalled the extension and added the --extension Playground flag to CMD_FLAGS.txt and got the exact same error message. The module "_mark_only_adapters_as_trainable" is commented out in script.py file; i.e., it isn't being used for anything. I deleted the "import _mark_only_adapters_as_trainable" line and it works again.

FartyPants commented 1 year ago

I don't know why I had the import there - I probably started something... then forgot about it. The line should be deleted or commented, it's fixed now