Update README.md
Browse files
README.md
CHANGED
|
@@ -85,7 +85,8 @@ The inference code for this model is available through the NeMo Curator GitHub r
|
|
| 85 |
|
| 86 |
# How to Use in Transformers
|
| 87 |
To use the multilingual domain classifier, use the following code:
|
| 88 |
-
|
|
|
|
| 89 |
import torch
|
| 90 |
from torch import nn
|
| 91 |
from transformers import AutoModel, AutoTokenizer, AutoConfig
|
|
@@ -118,6 +119,7 @@ outputs = model(inputs["input_ids"], inputs["attention_mask"])
|
|
| 118 |
predicted_classes = torch.argmax(outputs, dim=1)
|
| 119 |
predicted_domains = [config.id2label[class_idx.item()] for class_idx in predicted_classes.cpu().numpy()]
|
| 120 |
print(predicted_domains)
|
|
|
|
| 121 |
```
|
| 122 |
|
| 123 |
# Input & Output
|
|
|
|
| 85 |
|
| 86 |
# How to Use in Transformers
|
| 87 |
To use the multilingual domain classifier, use the following code:
|
| 88 |
+
|
| 89 |
+
```python
|
| 90 |
import torch
|
| 91 |
from torch import nn
|
| 92 |
from transformers import AutoModel, AutoTokenizer, AutoConfig
|
|
|
|
| 119 |
predicted_classes = torch.argmax(outputs, dim=1)
|
| 120 |
predicted_domains = [config.id2label[class_idx.item()] for class_idx in predicted_classes.cpu().numpy()]
|
| 121 |
print(predicted_domains)
|
| 122 |
+
# ['Sports', 'News']
|
| 123 |
```
|
| 124 |
|
| 125 |
# Input & Output
|