granite embedding 125m english
ibm-graniteIntroduction
The IBM GRANITE-EMBEDDING-125M-ENGLISH model is designed for sentence similarity tasks using Transformer architecture. It is implemented in PyTorch and utilizes Safetensors for efficient data handling. The model is optimized for the English language and employs the RoBERTa architecture for feature extraction and embeddings.
Architecture
IBM GRANITE-EMBEDDING-125M-ENGLISH is based on the RoBERTa architecture, which is a variant of BERT optimized for sentence representation tasks. The model provides robust embeddings that can be used for various tasks, including feature extraction and language modeling.
Training
Details of the training process are not provided in the visible documentation. However, models like these are typically trained on large-scale datasets to ensure their effectiveness in sentence similarity tasks and embeddings.
Guide: Running Locally
-
Install Dependencies: Ensure you have Python and PyTorch installed. Use pip to install the Hugging Face Transformers library.
pip install transformers
-
Load the Model: Use the Transformers library to load the model.
from transformers import RobertaModel, RobertaTokenizer tokenizer = RobertaTokenizer.from_pretrained("ibm-granite/granite-embedding-125m-english") model = RobertaModel.from_pretrained("ibm-granite/granite-embedding-125m-english")
-
Inference: Tokenize your input text and pass it through the model to obtain embeddings.
inputs = tokenizer("Your sentence here", return_tensors="pt") outputs = model(**inputs)
-
Cloud GPUs: For efficient processing, consider using cloud GPU services like AWS, Google Cloud, or Azure.
License
The IBM GRANITE-EMBEDDING-125M-ENGLISH model is licensed under the Apache 2.0 License, allowing for both personal and commercial use with proper attribution.