# Cannot access gated hugging face repo

**URL:** <https://forum.weaviate.io/t/cannot-access-gated-hugging-face-repo/1416>\
**Category:** Support\
**Tags:** bug, integration, python\
**Created:** [February 7, 2024, 1:48pm UTC](https://forum.weaviate.io/t/cannot-access-gated-hugging-face-repo/1416 "2024-02-07T13:48:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![erickfoxbase](https://avatars.discourse-cdn.com/v4/letter/e/898d66/32.png) [@erickfoxbase](https://forum.weaviate.io/u/erickfoxbase)\
**Post date:** [February 7, 2024, 1:48pm UTC](https://forum.weaviate.io/t/cannot-access-gated-hugging-face-repo/1416/1 "2024-02-07T13:48:38Z")

</div>

### Setup:

Weaviate 1.23.7  
weaviate-client = “4.4.1”

### Description

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

> **[jinaai/jina-embeddings-v2-base-de · Hugging Face](https://huggingface.co/jinaai/jina-embeddings-v2-base-de)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

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](https://huggingface.co/jinaai/jina-embeddings-v2-base-de) 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

---

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [February 7, 2024, 9:30pm UTC](https://forum.weaviate.io/t/cannot-access-gated-hugging-face-repo/1416/2 "2024-02-07T21:30:04Z")

</div>

Hi @erickfoxbase !

Is this the same scenario covered here?

> **[GitHub - weaviate/t2v-transformers-models: This is the repo for the container...](https://github.com/weaviate/t2v-transformers-models/tree/main?tab=readme-ov-file#custom-build-with-a-private--local-model)**
>
> main

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

This is the download script you are calling:

> <https://github.com/weaviate/t2v-transformers-models/blob/main/download.py>
