Update README.md
Browse files
README.md
CHANGED
@@ -2,9 +2,19 @@ FAVA, a verification model.
|
|
2 |
|
3 |
```
|
4 |
import torch
|
|
|
5 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
6 |
|
7 |
-
|
8 |
-
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
```
|
|
|
2 |
|
3 |
```
|
4 |
import torch
|
5 |
+
import vllm
|
6 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
7 |
|
8 |
+
model = vllm.LLM(model="fava-uw/fava-model")
|
9 |
+
sampling_params = vllm.SamplingParams(
|
10 |
+
temperature=0,
|
11 |
+
top_p=1.0,
|
12 |
+
max_tokens=1024,
|
13 |
+
)
|
14 |
+
output = "" # add your passage to verify
|
15 |
+
evidence = "" # add a piece of evidence
|
16 |
+
prompts = [INPUT.format_map({"evidence": evidence, "output": output})]
|
17 |
+
outputs = model.generate(prompts, sampling_params)
|
18 |
+
outputs = [it.outputs[0].text for it in outputs]
|
19 |
+
print(outputs[0])
|
20 |
```
|