Upload README.md
Browse files
README.md
CHANGED
@@ -5,7 +5,7 @@ license: mit
|
|
5 |
|
6 |
# model-card-testing
|
7 |
|
8 |
-
model-card-testing is a distilled language model that can be used for . Users of this model card should also consider information about the design, training, and limitations of gpt2.
|
9 |
|
10 |
## Model Details
|
11 |
|
@@ -20,7 +20,15 @@ model-card-testing is a distilled language model that can be used for . Users of
|
|
20 |
|
21 |
## How to Get Started with the Model
|
22 |
|
23 |
-
Use the code below to get started with the model.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
|
25 |
|
26 |
|
@@ -87,6 +95,16 @@ The impact of model compression techniques, such as knowledge distillation, on b
|
|
87 |
NOTE: This code will need customization/fixing.
|
88 |
|
89 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
|
91 |
|
92 |
|
|
|
5 |
|
6 |
# model-card-testing
|
7 |
|
8 |
+
model-card-testing is a distilled language model that can be used for text generation. Users of this model card should also consider information about the design, training, and limitations of gpt2.
|
9 |
|
10 |
## Model Details
|
11 |
|
|
|
20 |
|
21 |
## How to Get Started with the Model
|
22 |
|
23 |
+
Use the code below to get started with the model. model-card-testing can be used directly with a pipeline for text generation.
|
24 |
+
Since the generation relies on some randomness, we set a seed for reproducibility:
|
25 |
+
```python
|
26 |
+
>>> from transformers import pipeline, set_seed
|
27 |
+
>>> generator = pipeline('text-generation', model='model-card-testing')
|
28 |
+
>>> set_seed(42)
|
29 |
+
>>> generator("Hello, I'm a language model," max_length=20, num_return_sequences=5)
|
30 |
+
```
|
31 |
+
|
32 |
|
33 |
|
34 |
|
|
|
95 |
NOTE: This code will need customization/fixing.
|
96 |
|
97 |
|
98 |
+
```python
|
99 |
+
>>> from transformers import pipeline, set_seed
|
100 |
+
>>> generator = pipeline('text-generation', model='model-card-testing')
|
101 |
+
>>> set_seed(48)
|
102 |
+
>>> generator("The White man worked as a", max_length=20, num_return_sequences=3)
|
103 |
+
|
104 |
+
>>> set_seed(48)
|
105 |
+
>>> generator("The Black man worked as a", max_length=20, num_return_sequences=3)
|
106 |
+
```
|
107 |
+
|
108 |
|
109 |
|
110 |
|