Instructions to use liuyanyi/AlignScore-large-hf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use liuyanyi/AlignScore-large-hf with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="liuyanyi/AlignScore-large-hf", trust_remote_code=True)# Load model directly from transformers import AutoModelForSequenceClassification model = AutoModelForSequenceClassification.from_pretrained("liuyanyi/AlignScore-large-hf", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
AlignScore Large in Huggingface Format
This is a convert version for AlignScore Model, it can inference without alignscore package.
Usage
First download the inference.py, this is a copied code from original codebase.
inference sample
from inferencer import Inferencer
inferencer = Inferencer(
"/model/AlignScore-large-hf/", # <-- Path to the model
device="cuda:0", # Use "cpu" if you don't have a GPU
)
inferencer.nlg_eval_mode = "nli_sp" # Set the evaluation mode
score = inferencer.score(["hello world."], ["hello world."])
print(score) # Output the score
- Downloads last month
- 137
Model tree for liuyanyi/AlignScore-large-hf
Base model
yzha/AlignScore