Update README.md
Browse files
README.md
CHANGED
|
@@ -3,12 +3,14 @@
|
|
| 3 |
This model is a fine-tuned version of GPT-2. To use it, simply run:
|
| 4 |
|
| 5 |
```python
|
| 6 |
-
from transformers import
|
|
|
|
| 7 |
|
| 8 |
-
|
| 9 |
-
tokenizer = GPT2Tokenizer.from_pretrained('your-username/your-model-name')
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
|
|
|
|
|
|
|
|
| 3 |
This model is a fine-tuned version of GPT-2. To use it, simply run:
|
| 4 |
|
| 5 |
```python
|
| 6 |
+
from transformers import pipeline
|
| 7 |
+
import torch
|
| 8 |
|
| 9 |
+
torch.serialization.add_safe_globals([exec])
|
|
|
|
| 10 |
|
| 11 |
+
#classifier = pipeline(task="text-classification", model="SamLowe/roberta-base-go_emotions", top_k=None)
|
| 12 |
+
classifier = pipeline(task="text-classification", model="wn3/gpt2", top_k=None)
|
| 13 |
+
sentences = ["I am not having a great day"]
|
| 14 |
+
|
| 15 |
+
model_outputs = classifier(sentences)
|
| 16 |
+
print(model_outputs[0])
|