Update README.md
Browse files
README.md
CHANGED
|
@@ -7,3 +7,24 @@ library_name: transformers
|
|
| 7 |
|
| 8 |
# AlignScore Large in Huggingface Format
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
# AlignScore Large in Huggingface Format
|
| 9 |
|
| 10 |
+
|
| 11 |
+
This is a convert version for AlignScore Model, it can inference without alignscore package.
|
| 12 |
+
|
| 13 |
+
## Usage
|
| 14 |
+
|
| 15 |
+
First download the `inference.py`, this is a copied code from original codebase.
|
| 16 |
+
|
| 17 |
+
inference sample
|
| 18 |
+
|
| 19 |
+
```
|
| 20 |
+
from inferencer import Inferencer
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
inferencer = Inferencer(
|
| 24 |
+
"/model/AlignScore-large-hf/", # <-- Path to the model
|
| 25 |
+
device="cuda:0", # Use "cpu" if you don't have a GPU
|
| 26 |
+
)
|
| 27 |
+
inferencer.nlg_eval_mode = "nli_sp" # Set the evaluation mode
|
| 28 |
+
score = inferencer.score(["hello world."], ["hello world."])
|
| 29 |
+
print(score) # Output the score
|
| 30 |
+
```
|