Update README.md
Browse files
README.md
CHANGED
@@ -53,7 +53,31 @@ Given the training format, no extra care is needed to account for different sequ
|
|
53 |
|
54 |
## Performance
|
55 |
The resulting model matches SOTA performance with 82.5% accuracy.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
## How to use
|
58 |
The model can be easily loaded using AutoModelForCausalLM.
|
59 |
You can use the pipeline API for text generation.
|
@@ -61,8 +85,8 @@ You can use the pipeline API for text generation.
|
|
61 |
```python
|
62 |
from transformers import pipeline, AutoModelForCausalLM, AutoTokenizer
|
63 |
|
64 |
-
hf_model = AutoModelForCausalLM.from_pretrained("Graphcore/gptj-mnli")
|
65 |
tokenizer = AutoTokenizer.from_pretrained('EleutherAI/gpt-j-6B')
|
|
|
66 |
generator = pipeline('text-generation', model=hf_model, tokenizer=tokenizer)
|
67 |
prompt = "mnli hypothesis: Your contributions were of no help with our students' education." \
|
68 |
"premise: Your contribution helped make it possible for us to provide our students with a quality education. target:"
|
|
|
53 |
|
54 |
## Performance
|
55 |
The resulting model matches SOTA performance with 82.5% accuracy.
|
56 |
+
```
|
57 |
+
Total number of examples 9832
|
58 |
+
Number with badly formed result 0
|
59 |
+
Number with incorrect result 1725
|
60 |
+
Number with correct result 8107
|
61 |
+
[82.5%]
|
62 |
+
|
63 |
+
example 0 = {'prompt_text': "mnli hypothesis: Your contributions were of no help with our students' education.
|
64 |
+
premise: Your contribution helped make it possible for us to provide our students
|
65 |
+
with a quality education. target:",
|
66 |
+
'class_label': 'contradiction'}
|
67 |
+
result = {'generated_text': ' contradiction'}
|
68 |
|
69 |
+
First 10 generated_text and expected class_label results:
|
70 |
+
0: 'contradiction' contradiction
|
71 |
+
1: 'contradiction' contradiction
|
72 |
+
2: 'entailment' entailment
|
73 |
+
3: 'contradiction' contradiction
|
74 |
+
4: 'entailment' entailment
|
75 |
+
5: 'entailment' entailment
|
76 |
+
6: 'contradiction' contradiction
|
77 |
+
7: 'contradiction' contradiction
|
78 |
+
8: 'entailment' neutral
|
79 |
+
9: 'contradiction' contradiction
|
80 |
+
```
|
81 |
## How to use
|
82 |
The model can be easily loaded using AutoModelForCausalLM.
|
83 |
You can use the pipeline API for text generation.
|
|
|
85 |
```python
|
86 |
from transformers import pipeline, AutoModelForCausalLM, AutoTokenizer
|
87 |
|
|
|
88 |
tokenizer = AutoTokenizer.from_pretrained('EleutherAI/gpt-j-6B')
|
89 |
+
hf_model = AutoModelForCausalLM.from_pretrained("Graphcore/gptj-mnli", pad_token_id=tokenizer.eos_token_id)
|
90 |
generator = pipeline('text-generation', model=hf_model, tokenizer=tokenizer)
|
91 |
prompt = "mnli hypothesis: Your contributions were of no help with our students' education." \
|
92 |
"premise: Your contribution helped make it possible for us to provide our students with a quality education. target:"
|