Update README.md
Browse files
README.md
CHANGED
@@ -52,4 +52,14 @@ sketch = "your_sketch"
|
|
52 |
generated_text = genius(sketch, num_beams=3, do_sample=True, max_length=200)[0]['generated_text']
|
53 |
print(generated_text)
|
54 |
```
|
55 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
generated_text = genius(sketch, num_beams=3, do_sample=True, max_length=200)[0]['generated_text']
|
53 |
print(generated_text)
|
54 |
```
|
55 |
+
|
56 |
+
```
|
57 |
+
from transformers import pipeline
|
58 |
+
# 1. load the model with the huggingface `pipeline`
|
59 |
+
genius = pipeline("text2text-generation", model='beyond/genius-large', device=0)
|
60 |
+
# 2. provide a sketch (joint by <mask> tokens)
|
61 |
+
sketch = "<mask> Conference on Empirical Methods <mask> submission of research papers <mask> Deep Learning <mask>"
|
62 |
+
# 3. here we go!
|
63 |
+
generated_text = genius(sketch, num_beams=3, do_sample=True, max_length=200)[0]['generated_text']
|
64 |
+
print(generated_text)
|
65 |
+
```
|