Update README.md
Browse files
README.md
CHANGED
|
@@ -91,9 +91,9 @@ The sketch which can be composed of:
|
|
| 91 |
|
| 92 |
### How to use the model
|
| 93 |
#### 1. If you already have a sketch in mind, and want to get a paragraph based on it...
|
| 94 |
-
```
|
| 95 |
from transformers import pipeline
|
| 96 |
-
# 1. load the model with the huggingface
|
| 97 |
genius = pipeline("text2text-generation", model='beyond/genius-large', device=0)
|
| 98 |
# 2. provide a sketch (joint by <mask> tokens)
|
| 99 |
sketch = "<mask> Conference on Empirical Methods <mask> submission of research papers <mask> Deep Learning <mask>"
|
|
@@ -101,8 +101,9 @@ sketch = "<mask> Conference on Empirical Methods <mask> submission of research p
|
|
| 101 |
generated_text = genius(sketch, num_beams=3, do_sample=True, max_length=200)[0]['generated_text']
|
| 102 |
print(generated_text)
|
| 103 |
```
|
|
|
|
| 104 |
Output:
|
| 105 |
-
```
|
| 106 |
'The Conference on Empirical Methods welcomes the submission of research papers. Abstracts should be in the form of a paper or presentation. Please submit abstracts to the following email address: eemml.stanford.edu. The conference will be held at Stanford University on April 1618, 2019. The theme of the conference is Deep Learning.'
|
| 107 |
```
|
| 108 |
|
|
|
|
| 91 |
|
| 92 |
### How to use the model
|
| 93 |
#### 1. If you already have a sketch in mind, and want to get a paragraph based on it...
|
| 94 |
+
```
|
| 95 |
from transformers import pipeline
|
| 96 |
+
# 1. load the model with the huggingface pipeline
|
| 97 |
genius = pipeline("text2text-generation", model='beyond/genius-large', device=0)
|
| 98 |
# 2. provide a sketch (joint by <mask> tokens)
|
| 99 |
sketch = "<mask> Conference on Empirical Methods <mask> submission of research papers <mask> Deep Learning <mask>"
|
|
|
|
| 101 |
generated_text = genius(sketch, num_beams=3, do_sample=True, max_length=200)[0]['generated_text']
|
| 102 |
print(generated_text)
|
| 103 |
```
|
| 104 |
+
|
| 105 |
Output:
|
| 106 |
+
```
|
| 107 |
'The Conference on Empirical Methods welcomes the submission of research papers. Abstracts should be in the form of a paper or presentation. Please submit abstracts to the following email address: eemml.stanford.edu. The conference will be held at Stanford University on April 1618, 2019. The theme of the conference is Deep Learning.'
|
| 108 |
```
|
| 109 |
|