NeMo-Guardrails icon indicating copy to clipboard operation
NeMo-Guardrails copied to clipboard

Trouble With Getting HuggingFace Models to Work

Open imintollms opened this issue 1 year ago • 1 comments

Hello,

I've been able to get OpenAI and Bedrock models to work as the main model in Nemo Guardrails, but for some reason I've been having real trouble with Dolly. I used the classic configuration:

Screenshot 2024-03-02 145318 Screenshot 2024-03-02 145415 Screenshot 2024-03-02 145436 Screenshot 2024-03-02 145453 Screenshot 2024-03-02 145612

The error is "Error while execution generate_user_intent: 'HuggingFacePipeline' object has no attribute '_acall'", but I thought I saw that it was defined in the Guardrails Library.

Has anyone has an error like this?

imintollms avatar Mar 02 '24 19:03 imintollms

Hi @imintollms ,

For HF models you should use nemoguardrails.llm.providers.HuggingFacePipelineCompatible instead of the vanilla HuggingFacePipeline, similar to this: https://github.com/NVIDIA/NeMo-Guardrails/blob/8bb50afc68060e6c46d6fc557bcdb97cffec0fc8/examples/configs/llm/hf_pipeline_dolly/config.py#L60

This will solve your problem.

trebedea avatar Mar 02 '24 23:03 trebedea