TrustLLM icon indicating copy to clipboard operation
TrustLLM copied to clipboard

AttributeError : HARM_CATEGORY_DEROGATORY

Open andytan0051 opened this issue 1 year ago • 5 comments

I installed the framework using pip and somehow received this error while following the documentation.

image

from trustllm.generation.generation import LLMGeneration

llm_gen = LLMGeneration(
    model_path="'mistralai/Mistral-7B-Instruct-v0.1'", 
    test_type="truthfulness", 
    data_path="dataset",
    online_model=False, 
    use_deepinfra=False,
    use_replicate=False,
    repetition_penalty=1.0,
    num_gpus=1, 
    max_new_tokens=512, 
    debug=False,
    device='cuda:0'
)

llm_gen.generation_results()

I would appreciate some guidance :) Thanks!

andytan0051 avatar Dec 19 '24 14:12 andytan0051

I believe it is due to the deprecation of PALM models.

andytan0051 avatar Dec 23 '24 14:12 andytan0051

Yes, currently, only the Gemini family types are supported, which are the following: HARM_CATEGORY_HARASSMENT HARM_CATEGORY_HATE_SPEECH HARM_CATEGORY_SEXUALLY_EXPLICIT HARM_CATEGORY_DANGEROUS_CONTENT HARM_CATEGORY_UNSPECIFIED

sudarsun avatar Jan 06 '25 10:01 sudarsun

I want to run privacy evaluations , but am having the same issue as @andytan0051 when I try to import. Any update on a workaround or fix?

CaptiveCoder avatar Feb 17 '25 18:02 CaptiveCoder

@CaptiveCoder Try changing the safety setting defined in trustllm_pkg/trustllm/utils/generation_utils.py to the categories mentioned by @sudarsun above. That should solve the problem. Also if possible, install the framework through git clone instead of pip. The pip installed version is outdated and some bugs are left in there.

andytan0051 avatar Feb 17 '25 20:02 andytan0051

I want to run privacy evaluations , but am having the same issue as @andytan0051 when I try to import. Any update on a workaround or fix?

Hi,

Please use git clone instead of pip install. The pip install is now out of update.

HowieHwong avatar Feb 17 '25 23:02 HowieHwong