Closed ba2512005 closed 5 months ago
Also similar error for multiple personalities (Lord of Internet / wikipedia and others that use Processor.run_workflow() )
Traceback (most recent call last): File "C:\Users\ba251\lollms-webui\scripts\windows\lollms-webui\lollms_webui.py", line 1262, in generate self.personality.processor.run_workflow( prompt, full_prompt, callback, context_details) TypeError: Processor.run_workflow() takes from 2 to 4 positional arguments but 5 were given
Workflow run failed. Error:Processor.run_workflow() takes from 2 to 4 positional arguments but 5 were given Traceback (most recent call last): File "C:\Users\ba251\lollms-webui\scripts\windows\lollms-webui\lollms_webui.py", line 1262, in generate self.personality.processor.run_workflow( prompt, full_prompt, callback, context_details) TypeError: Processor.run_workflow() takes from 2 to 4 positional arguments but 5 were given
Workflow run failed Error:Processor.run_workflow() takes from 2 to 4 positional arguments but 5 were given --> Exception from personality:Workflow run failed Error:Processor.run_workflow() takes from 2 to 4 positional arguments but 5 were given Finished executing the workflow
upon further debugging, I found that it also fails in calling the decode command for the results since it passes them as a list.
seems like the tokenizer.py in exllamav2 decode function doesn't take a list of tensors into account.
This modified decode function seems to make it work somewhat:
def decode(self, ids, decode_special_tokens = False):
# if ids.is_list:
# return [self.decode(ids, decode_special_tokens) for ids in ids]
if type(ids) == torch.Tensor:
if ids.dim() > 1:
texts = []
for i in range(ids.shape[0]):
seq = ids[i].tolist()
texts.append(self.decode_(seq, decode_special_tokens))
return texts
else:
ids = ids.tolist()
text = self.decode_(ids, decode_special_tokens)
return text
elif type(ids) == list:
texts = []
for id in ids:
texts.append(self.decode(id, decode_special_tokens))
return texts
Created pull request in exllamav2: https://github.com/turboderp/exllamav2/pull/296
Additionally it seems some personalities are based on older generation code and need to be re-created and cleaned up.
I made it work by modifying the def run_workflow definition in the file: zoos/personality_zoo/internet/
from:
def run_workflow(self, prompt, previous_discussion_text="", callback=None):
to:
def run_workflow(self, prompt: str, previous_discussion_text: str = "", callback: Callable[[str, MSG_TYPE, dict, list], bool] = None, context_details: dict = None):
and importing:
from typing import Callable
@ParisNeo I just looked through the code and found 3 that need to be changed: Thinking_methodologies/tree_of_thoughts (which you already did)
Additionally: Thinking_methodologies/chain_of_thoughts data/database_maker data/text2bulletpoints
Thanks I'll fix them now
Well got distracted by something else and didn't do it. I'll try tomorrow if i find the Time
personalities updated
Expected Behavior
Personalities should work as intended. Get's stuck in warming up on the UI screen and the server outputs error message below.
Current Behavior
Some personalities fail on the workflow execution.
Workflow run failed. Error:Processor.run_workflow() takes from 2 to 4 positional arguments but 5 were given Traceback (most recent call last): File "C:\Users\ba251\lollms-webui\scripts\windows\lollms-webui\lollms_webui.py", line 1262, in generate self.personality.processor.run_workflow( prompt, full_prompt, callback, context_details) TypeError: Processor.run_workflow() takes from 2 to 4 positional arguments but 5 were given
Steps to Reproduce
Load lord of internet personality on windows with exllamav2 binding using cpu mode.
Possible Solution
Seems like there's a positional argument issue where it's expecting 2-4 arguments but 5 were given, the function declaration and the calling function are different. The generator used for creating this personality is older than the one calling it, having a mismatch of argument types. When debugging, it points to the generator instead of the generated code. after some digging I found the solution
Edit: see comments below on fix.
Context
Personalities that search the internet. Using Windows 11, CPU mode, exllama binding
Screenshots
There is no error on the UI portion. Not sure if it's enabling it or not