Update README.md
Browse files
README.md
CHANGED
@@ -52,6 +52,24 @@ LongForm-**T5-XL**: https://huggingface.co/akoksal/LongForm-T5-XL
|
|
52 |
|
53 |
LongForm-**OPT-2.7B**: https://huggingface.co/akoksal/LongForm-OPT-2.7B
|
54 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
|
56 |
## Evaluation
|
57 |
We provide in-depth evaluation of LongForm models and baselines in the paper. We present the METEOR scores of models in out-of-domain datasets. In all tasks, Recipe Generation (RGen), long-form question answering (ELI5), short story generation (WritingPrompts/WP), LongForm models outperform prior instruction-tuned models.
|
|
|
52 |
|
53 |
LongForm-**OPT-2.7B**: https://huggingface.co/akoksal/LongForm-OPT-2.7B
|
54 |
|
55 |
+
## How to Load
|
56 |
+
```python
|
57 |
+
import torch
|
58 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
59 |
+
model = AutoModelForCausalLM.from_pretrained("akoksal/LongForm-OPT-6.7B")
|
60 |
+
tokenizer = AutoTokenizer.from_pretrained("akoksal/LongForm-OPT-6.7B")
|
61 |
+
|
62 |
+
instruction = "Write an essay about meditation. [EOI]"
|
63 |
+
torch.manual_seed(42)
|
64 |
+
input_ids = tokenizer(instruction, return_tensors="pt").input_ids
|
65 |
+
target_ids = model.generate(input_ids, do_sample=True, max_new_tokens=50, top_p=0.9)
|
66 |
+
tokenizer.decode(target_ids[0])
|
67 |
+
# Output:
|
68 |
+
# > </s>Write an essay about meditation. [EOI]Meditation is a way to quiet the\
|
69 |
+
# mind, focus on the present, and achieve a calm and serene state of mind.\
|
70 |
+
# In today's society, people are constantly running from one thing to the next.\
|
71 |
+
# In order to maintain good mental health,
|
72 |
+
```
|
73 |
|
74 |
## Evaluation
|
75 |
We provide in-depth evaluation of LongForm models and baselines in the paper. We present the METEOR scores of models in out-of-domain datasets. In all tasks, Recipe Generation (RGen), long-form question answering (ELI5), short story generation (WritingPrompts/WP), LongForm models outperform prior instruction-tuned models.
|