Run the examples in slow

This commit is contained in:
Lysandre
2020-01-22 19:24:02 -05:00
committed by Lysandre Debut
parent 9ddf60b694
commit 24d5ad1dcc
24 changed files with 249 additions and 54 deletions

View File

@@ -313,10 +313,15 @@ class CTRLModel(CTRLPreTrainedModel):
Examples::
from transformers import CTRLTokenizer, CTRLModel
import torch
tokenizer = CTRLTokenizer.from_pretrained('ctrl')
model = CTRLModel.from_pretrained('ctrl')
input_ids = torch.tensor(tokenizer.encode("Links Hello, my dog is cute", add_special_tokens=True)).unsqueeze(0) # Batch size 1
outputs = model(input_ids)
last_hidden_states = outputs[0] # The last hidden-state is the first element of the output tuple
"""