Curator icon indicating copy to clipboard operation
Curator copied to clipboard

Unable to use models which need `trust_remote_code=True` in `EmbeddingCreatorStage`

Open kipraveen opened this issue 11 months ago • 1 comments

Describe the bug

When using models like nvidia/llama-3.2-nv-embedqa-1b-v2 in EmbeddingCreatorStage, the pipeline fails with

ValueError: The repository nvidia/llama-3.2-nv-embedqa-1b-v2 contains custom code which must be executed to correctly load the model. You can inspect the repository content at https://hf.co/nvidia/llama-3.2-nv-embedqa-1b-v2 .
 You can inspect the repository content at https://hf.co/nvidia/llama-3.2-nv-embedqa-1b-v2.
Please pass the argument `trust_remote_code=True` to allow custom code to be run.

Steps/Code to reproduce bug

  1. Use EmbeddingCreatorStage in a pipeline
  2. Set `model_identifier='nvidia/llama-3.2-nv-embedqa-1b-v2'

Expected behavior

Model runs without issues and produces embeddings.

Additional context

The issue happens because the variable trust_remote_code that could be used in the initialization of from_pretrained is not exposed to the user in the scripts

  • https://github.com/NVIDIA-NeMo/Curator/blob/57f9666ce5546c0c420999df4f5fd952794d0f68/nemo_curator/stages/text/models/tokenizer.py#L109
  • https://github.com/NVIDIA-NeMo/Curator/blob/57f9666ce5546c0c420999df4f5fd952794d0f68/nemo_curator/stages/text/embedders/base.py#L62

kipraveen avatar Dec 12 '25 06:12 kipraveen

Good catch, thanks @kipraveen ! We can definitely update our tokenizer and model stages with more flexible parameters.

sarahyurick avatar Dec 12 '25 22:12 sarahyurick