how to sovle the" A new version of the following files was downloaded from https://huggingface.co/jinaai/xlm-roberta-flash-implementation:"

#101
by gauyer - opened

I use the transformers to load the jina-v3, and I can not solve the issue below, can anybody teach me?
A new version of the following files was downloaded from https://huggingface.co/jinaai/xlm-roberta-flash-implementation:

  • configuration_xlm_roberta.py
    . Make sure to double-check they do not contain any added malicious code. To avoid downloading new versions of the code file, you can pin a revision.
    A new version of the following files was downloaded from https://huggingface.co/jinaai/xlm-roberta-flash-implementation:
  • rotary.py
    . Make sure to double-check they do not contain any added malicious code. To avoid downloading new versions of the code file, you can pin a revision.
    A new version of the following files was downloaded from https://huggingface.co/jinaai/xlm-roberta-flash-implementation:
  • mha.py
  • rotary.py
    . Make sure to double-check they do not contain any added malicious code. To avoid downloading new versions of the code file, you can pin a revision.
    A new version of the following files was downloaded from https://huggingface.co/jinaai/xlm-roberta-flash-implementation:
  • xlm_padding.py
    . Make sure to double-check they do not contain any added malicious code. To avoid downloading new versions of the code file, you can pin a revision.
    A new version of the following files was downloaded from https://huggingface.co/jinaai/xlm-roberta-flash-implementation:
  • stochastic_depth.py
    . Make sure to double-check they do not contain any added malicious code. To avoid downloading new versions of the code file, you can pin a revision.
    A new version of the following files was downloaded from https://huggingface.co/jinaai/xlm-roberta-flash-implementation:
  • mlp.py
    . Make sure to double-check they do not contain any added malicious code. To avoid downloading new versions of the code file, you can pin a revision.
    A new version of the following files was downloaded from https://huggingface.co/jinaai/xlm-roberta-flash-implementation:
  • block.py
  • stochastic_depth.py
  • mlp.py
    . Make sure to double-check they do not contain any added malicious code. To avoid downloading new versions of the code file, you can pin a revision.
    A new version of the following files was downloaded from https://huggingface.co/jinaai/xlm-roberta-flash-implementation:
  • embedding.py
    . Make sure to double-check they do not contain any added malicious code. To avoid downloading new versions of the code file, you can pin a revision.
    A new version of the following files was downloaded from https://huggingface.co/jinaai/xlm-roberta-flash-implementation:
  • modeling_xlm_roberta.py
  • mha.py
  • xlm_padding.py
  • block.py
  • embedding.py
    . Make sure to double-check they do not contain any added malicious code. To avoid downloading new versions of the code file, you can pin a revision.
    A new version of the following files was downloaded from https://huggingface.co/jinaai/xlm-roberta-flash-implementation:
  • modeling_lora.py
  • modeling_xlm_roberta.py
    . Make sure to double-check they do not contain any added malicious code. To avoid downloading new versions of the code file, you can pin a revision.
    flash_attn is not installed. Using PyTorch native attention implementation.
    flash_attn is not installed. Using PyTorch native attention implementation.
    flash_attn is not installed. Using PyTorch native attention implementation.
    flash_attn is not installed. Using PyTorch native attention implementation.
    flash_attn is not installed. Using PyTorch native attention implementation.
    flash_attn is not installed. Using PyTorch native attention implementation.
    flash_attn is not installed. Using PyTorch native attention implementation.
    flash_attn is not installed. Using PyTorch native attention implementation.
    flash_attn is not installed. Using PyTorch native attention implementation.
    flash_attn is not installed. Using PyTorch native attention implementation.
    flash_attn is not installed. Using PyTorch native attention implementation.
    flash_attn is not installed. Using PyTorch native attention implementation.
    flash_attn is not installed. Using PyTorch native attention implementation.
    flash_attn is not installed. Using PyTorch native attention implementation.
    flash_attn is not installed. Using PyTorch native attention implementation.
    flash_attn is not installed. Using PyTorch native attention implementation.
    flash_attn is not installed. Using PyTorch native attention implementation.
    flash_attn is not installed. Using PyTorch native attention implementation.
    flash_attn is not installed. Using PyTorch native attention implementation.
    flash_attn is not installed. Using PyTorch native attention implementation.
    flash_attn is not installed. Using PyTorch native attention implementation.
    flash_attn is not installed. Using PyTorch native attention implementation.
    flash_attn is not installed. Using PyTorch native attention implementation.
    flash_attn is not installed. Using PyTorch native attention implementation.
    flash_attn is not installed. Using PyTorch native attention implementation.
    Traceback (most recent call last):
    File "/mnt/work/parallel_dataset/data1228(2)/generate_emb_jinav3_.py", line 91, in
    main()
    File "/mnt/work/parallel_dataset/data1228(2)/generate_emb_jinav3_.py", line 45, in main
    model = AutoModel.from_pretrained("jinaai/jina-embeddings-v3", trust_remote_code=True)
    File "/root/.pyenv/versions/3.10.10/lib/python3.10/site-packages/transformers/models/auto/auto_factory.py", line 559, in from_pretrained
    return model_class.from_pretrained(
    File "/mnt/work/huggingface/modules/transformers_modules/jinaai/xlm-roberta-flash-implementation/2b6bc3f30750b3a9648fe9b63448c09920efe9be/modeling_lora.py", line 338, in from_pretrained
    return super().from_pretrained(
    File "/mnt/work/huggingface/modules/transformers_modules/jinaai/xlm-roberta-flash-implementation/2b6bc3f30750b3a9648fe9b63448c09920efe9be/modeling_xlm_roberta.py", line 442, in from_pretrained
    return super().from_pretrained(*args, **kwargs)
    File "/root/.pyenv/versions/3.10.10/lib/python3.10/site-packages/transformers/modeling_utils.py", line 4264, in from_pretrained
    ) = cls._load_pretrained_model(
    File "/root/.pyenv/versions/3.10.10/lib/python3.10/site-packages/transformers/modeling_utils.py", line 4593, in _load_pretrained_model
    for name, param in model.named_parameters():
    File "/mnt/work/huggingface/modules/transformers_modules/jinaai/xlm-roberta-flash-implementation/2b6bc3f30750b3a9648fe9b63448c09920efe9be/modeling_lora.py", line 381, in named_parameters
    for name, param in super().named_parameters(
    TypeError: Module.named_parameters() got an unexpected keyword argument 'remove_duplicate'
Jina AI org

Hi @gauyer , I was unable to reproduce this error. Can you share the transformers version?

I'm seeing this as well.

pip list:
annotated-types 0.7.0
anyio 4.8.0
certifi 2024.12.14
charset-normalizer 3.4.1
click 8.1.8
einops 0.8.0
exceptiongroup 1.2.2
fastapi 0.115.6
filelock 3.13.1
fsspec 2024.2.0
h11 0.14.0
huggingface-hub 0.27.1
idna 3.10
Jinja2 3.1.3
joblib 1.4.2
MarkupSafe 2.1.5
mpmath 1.3.0
networkx 3.2.1
numpy 1.26.3
packaging 24.2
pillow 10.2.0
pip 23.0.1
pydantic 2.10.5
pydantic_core 2.27.2
PyYAML 6.0.2
regex 2024.11.6
requests 2.32.3
safetensors 0.5.2
scikit-learn 1.6.1
scipy 1.13.1
sentence-transformers 3.3.1
setuptools 58.1.0
sniffio 1.3.1
starlette 0.41.3
sympy 1.13.1
threadpoolctl 3.5.0
tokenizers 0.21.0
torch 2.5.1+cpu
torchaudio 2.5.1+cpu
torchvision 0.20.1+cpu
tqdm 4.67.1
transformers 4.48.1
typing_extensions 4.12.2
urllib3 2.3.0
uvicorn 0.34.0
wheel 0.45.1

Dockerfile:

# Dockerfile
FROM python:3.9-slim

# Set the working directory
WORKDIR /app

# Copy requirements and install
COPY requirements.txt .
RUN pip3 install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu

RUN pip3 install --no-cache-dir -r requirements.txt

# Copy the application code
COPY app.py .

# Expose the default port (default to 8000, but can be overridden by environment variable)
ENV PORT=8000
EXPOSE $PORT

# Command to run the application, using the PORT environment variable
CMD uvicorn app:app --host 0.0.0.0 --port $PORT

Sign up or log in to comment