bleurt tiny 128
ElronIntroduction
BLEURT-TINY-128 is a PyTorch version of the original BLEURT models, which are designed to provide robust metrics for text generation. This model was introduced in the ACL paper "BLEURT: Learning Robust Metrics for Text Generation" by Thibault Sellam, Dipanjan Das, and Ankur P. Parikh from Google Research.
Architecture
BLEURT-TINY-128 utilizes a BERT architecture to perform sequence classification tasks. It is implemented using the PyTorch library and supports various text classification pipelines.
Training
The model was converted from its original TensorFlow version to PyTorch with the help of specific conversion scripts. The detailed procedures and code for this conversion are shared in resources linked within the documentation.
Guide: Running Locally
To run BLEURT-TINY-128 locally, follow these steps:
-
Set up your environment:
- Install the necessary Python packages, especially
transformers
andtorch
.
- Install the necessary Python packages, especially
-
Load the model and tokenizer:
from transformers import AutoModelForSequenceClassification, AutoTokenizer import torch tokenizer = AutoTokenizer.from_pretrained("Elron/bleurt-tiny-512") model = AutoModelForSequenceClassification.from_pretrained("Elron/bleurt-tiny-512") model.eval()
-
Prepare your data:
- Define reference and candidate sentences.
references = ["hello world", "hello world"] candidates = ["hi universe", "bye world"]
-
Run inference:
with torch.no_grad(): scores = model(**tokenizer(references, candidates, return_tensors='pt'))[0].squeeze() print(scores) # Outputs: tensor([-1.0563, -0.3004])
-
Consider using cloud GPUs:
- For enhanced performance and faster computation, consider using cloud-based GPUs from providers like AWS, Azure, or Google Cloud.
License
The model and its code are subject to licensing agreements as outlined by the creators and hosting platform. Users should refer to the official repository for specific license details.