Cannot access gated hugging face repo

Setup:

Weaviate 1.23.7
weaviate-client = “4.4.1”

Description

I want to use the latest German language model by Jina AI:

It is a gated model and they request a token from the hugging face CLI. I have done so but I have issues injecting the token into my Docker file. To deploy the text2vec module with my custom image I have the following jina_ve.Dockerfile

ARG HF_TOKEN
ENV HF_TOKEN=${HF_TOKEN}
FROM semitechnologies/transformers-inference:custom
RUN USE_SENTENCE_TRANSFORMERS_VECTORIZER=true MODEL_NAME=jinaai/jina-embeddings-v2-base-de ./download.py --token ${HF_TOKEN}

it includes the latest flag to use sentence transformers. Then I run:

sudo docker build --build-arg HF_TOKEN=<your_token> -f jina_v2.Dockerfile -t jina_v2-inference .

I have tried several modifications to the scripts above but I still get an error like this:

3.381 OSError: You are trying to access a gated repo.
3.381 Make sure to request access at jinaai/jina-embeddings-v2-base-de · Hugging Face and pass a token having permission to this repo either by logging in with huggingface-cli login or by passing token=<your_token>

So:

Is the tex2vec-transformers module able to access gated repos from hugging face?

Could you please provide me of an example of the docker file and shell command to build an image from a gated repo?

Thank you

Hi @erickfoxbase !

Is this the same scenario covered here?

I believe you download the model beforehand, then build the image with it.

This is the download script you are calling: