File size: 664 Bytes
e4bbd30
 
e0a8e70
e4bbd30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# install this lib : pip install {PATH}/ParaPLUIE

from .ppluie import ppluie

template = "FS-DIRECT"

device = "cuda:1"

scorer = ppluie("mistralai/Mistral-7B-Instruct-v0.2", device)
scorer.setTemplate(template)

# to show available prompting templates styles
scorer.show_templates()
# to show how is the prompt encoded, to ensure that the correct numbers of special tokens are removed
# and Yes / No words fit on one token
scorer.chech_end_tokens_tmpl()
# to show LLM already tested with ParaPLUIE
scorer.show_available_models()

S = "Have you ever seen a tsunami ?"   	
H = "Have you ever seen a tiramisu ?"

score = scorer(S, H)

print("Result score : ",score)