Instructions to use yseop/roberta-base-finance-hypernym-identification with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use yseop/roberta-base-finance-hypernym-identification with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("yseop/roberta-base-finance-hypernym-identification") sentences = [ "That is a happy person", "That is a happy dog", "That is a very happy person", "Today is a sunny day" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Transformers
How to use yseop/roberta-base-finance-hypernym-identification with Transformers:
# Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("yseop/roberta-base-finance-hypernym-identification") model = AutoModel.from_pretrained("yseop/roberta-base-finance-hypernym-identification", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Error during import
I have the following error during import:
model = SentenceTransformer('yseop/roberta-base-finance-hypernym-identification')
OSError: Error no file named pytorch_model.bin, tf_model.h5, model.ckpt.index or flax_model.msgpack found in directory /home/jovyan/.cache/huggingface/hub/models--yseop--roberta-base-finance-hypernym-identification/snapshots/d489979593cfcb516764dc180418f55ce051e886/0_Transformer.
Hello, if I'm not mistaken this Error has to do with HF changing the way the model is loaded. The "pytorch_model.bin" file is present in the model files, it just needs to be moved to the "0_Transformer" sub-directory. Best.