Use locally downloaded Hugging Face model from langchain4j

127 views Asked by At

I have successfully downloaded following Hugging Face sentence similarity model to local directory:

https://huggingface.co/kinit/slovakbert-sts-stsb

Structure of the model is:

config.json
config_sentence_transformers.json
merges.txt
modules.json
pytorch_model.bin
README.md
sentence_bert_config.json
special_tokens_map.json
tokenizer.json
tokenizer_config.json
vocab.json

Apparently the model itself is in file: pytorch_model.bin

I am using langchain4j. I have found following extension for Hugging Face:

https://github.com/langchain4j/langchain4j/tree/main/langchain4j-hugging-face

I am little bit confused as many methods are using Hugging Face api key??

My question is, how to connect my locally downloaded model with my langchain4j code, allowing me to write statements like:

EmbeddingModel huggingFaceModel = new EmbeddingModel()

Can you help me?

0

There are 0 answers