patrickrchao / JailbreakingLLMs

https://jailbreaking-llms.github.io/
MIT License
423 stars 62 forks source link

TypeError: object of type 'NoneType' has no len() #14

Open awarenessaspie opened 2 months ago

awarenessaspie commented 2 months ago

Traceback (most recent call last): File "C:\Users\hawke\JailbreakingLLMs\main.py", line 188, in main(args) File "C:\Users\hawke\JailbreakingLLMs\main.py", line 38, in main extracted_attack_list = attackLM.get_attack(convs_list, processed_response_list) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\hawke\JailbreakingLLMs\conversers.py", line 86, in get_attack full_prompts.append(conv.get_prompt()[:-len(conv.sep2)]) ^^^^^^^^^^^^^^ TypeError: object of type 'NoneType' has no len()

I encounter this error. What should I do?

dirtycomputer commented 2 months ago

same question

dirtycomputer commented 2 months ago

extracted_attack_list = [attack for attack in extracted_attack_list if attack is not None]

xndong commented 2 days ago

Very toxic repo to the community, I believe. I spent 2 days to fix many bugs in their repos.