Instructions to use stanfordnlp/mrt5-small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use stanfordnlp/mrt5-small with Transformers:
# Load model directly from transformers import AutoModelForSeq2SeqLM model = AutoModelForSeq2SeqLM.from_pretrained("stanfordnlp/mrt5-small", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update modeling_mrt5.py
Browse files- modeling_mrt5.py +2 -2
modeling_mrt5.py
CHANGED
|
@@ -8,7 +8,7 @@ import torch
|
|
| 8 |
import copy
|
| 9 |
import numpy as np
|
| 10 |
from torch import nn
|
| 11 |
-
from
|
| 12 |
T5Attention,
|
| 13 |
T5LayerNorm,
|
| 14 |
T5LayerFF,
|
|
@@ -16,7 +16,7 @@ from models.modeling_t5 import (
|
|
| 16 |
T5ForConditionalGeneration,
|
| 17 |
softmax1,
|
| 18 |
)
|
| 19 |
-
from configuration_mrt5 import MrT5Config
|
| 20 |
from transformers.modeling_outputs import (
|
| 21 |
BaseModelOutput,
|
| 22 |
BaseModelOutputWithPastAndCrossAttentions,
|
|
|
|
| 8 |
import copy
|
| 9 |
import numpy as np
|
| 10 |
from torch import nn
|
| 11 |
+
from .modeling_t5 import (
|
| 12 |
T5Attention,
|
| 13 |
T5LayerNorm,
|
| 14 |
T5LayerFF,
|
|
|
|
| 16 |
T5ForConditionalGeneration,
|
| 17 |
softmax1,
|
| 18 |
)
|
| 19 |
+
from .configuration_mrt5 import MrT5Config
|
| 20 |
from transformers.modeling_outputs import (
|
| 21 |
BaseModelOutput,
|
| 22 |
BaseModelOutputWithPastAndCrossAttentions,
|