# Weaviate with text2vec-huggingface not work for me

**URL:** <https://forum.weaviate.io/t/weaviate-with-text2vec-huggingface-not-work-for-me/323>\
**Category:** Support\
**Created:** [July 4, 2023, 11:50pm UTC](https://forum.weaviate.io/t/weaviate-with-text2vec-huggingface-not-work-for-me/323 "2023-07-04T23:50:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JuansePelaez](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/juansepelaez/32/251_2.png) [@JuansePelaez](https://forum.weaviate.io/u/JuansePelaez)\
**Post date:** [July 4, 2023, 11:50pm UTC](https://forum.weaviate.io/t/weaviate-with-text2vec-huggingface-not-work-for-me/323/1 "2023-07-04T23:50:47Z")

</div>

I have been trying to integrate Weaviate with HuggingFace, but I have encountered an issue when building the embeddings.

This is the schema I have developed, with the fields and all the required configurations.

```auto
client = weaviate.Client(
        url=url,
        additional_headers={"X-HuggingFace-Api-Key": "XXX"}
    )

class_obj = {
    "class": WEAVIATE_CLASS_NAME,
    "description": "Weaviate class for embeddings",
    "moduleConfig": {
        "text2vec-huggingface": {
            # "model": EMBED_MODEL_NAME,
            "endpointURL": "https://api-inference.huggingface.co/models/hackathon-pln-es/paraphrase-spanish-distilroberta",
            "options": {
                "waitForModel": True,
                "useGPU": False,
                "useCache": True
            },
            "vectorizeClassName": False
        }
    },
    "properties": [
        {"dataType": ["text"], "name": "subject_label"},
        {"dataType": ["text"],
         "moduleConfig": {
             "text2vec-huggingface": {
                 "skip": False,
                 "vectorizePropertyName": False
             }
         },
         "name": "text"},
        {"dataType": ["text"], "name": "source"},
    ],
    # "vectorizer": "none",
    "vectorizer": "text2vec-huggingface"
}

client.schema.create_class(class_obj)

```

Additionally, this is the code snippet I use to populate the database.

```auto
with client.batch(batch_size=100):
    for idx, row in data.iterrows():
        data_obj = {"subject_label": row["subject_label"], "text": row["text"],
                    "source": row["source"]}
        client.batch.add_data_object(data_obj, WEAVIATE_CLASS_NAME)

```

However, this is the result I always get once the code is executed.

> {‘error’: [{‘message’: ‘update vector: send POST request: Post “[https://api-inference.huggingface.co/models/hackathon-pln-es/paraphrase-spanish-distilroberta](https://api-inference.huggingface.co/models/hackathon-pln-es/paraphrase-spanish-distilroberta)”: dial tcp 54.209.188.203:443: i/o timeout’}]}  
> {‘error’: [{‘message’: ‘update vector: send POST request: Post “[https://api-inference.huggingface.co/models/hackathon-pln-es/paraphrase-spanish-distilroberta](https://api-inference.huggingface.co/models/hackathon-pln-es/paraphrase-spanish-distilroberta)”: dial tcp 54.209.188.203:443: i/o timeout’}]}

---

<div class="post-metadata">

**Author:** ![jphwang](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/jphwang/32/38_2.png) [@jphwang](https://forum.weaviate.io/u/jphwang)\
**Post date:** [July 5, 2023, 7:40pm UTC](https://forum.weaviate.io/t/weaviate-with-text2vec-huggingface-not-work-for-me/323/2 "2023-07-05T19:40:25Z")

</div>

Hi @JuansePelaez - I haven’t seen that error myself before, but it looks like the HF endpoint API is timing out, from the message.

Have you confirmed that the endpoint is accessible?

@antas-marcin - could you please take a brief look when you have some time? Thank you
