MCPcopy Create free account
hub / github.com/huggingface/transformers / test_tiny_model

Method test_tiny_model

tests/test_modeling_bart.py:196–203  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

194 pass
195
196 def test_tiny_model(self):
197 model_name = "sshleifer/bart-tiny-random"
198 tiny = AutoModel.from_pretrained(model_name) # same vocab size
199 tok = AutoTokenizer.from_pretrained(model_name) # same tokenizer
200 inputs_dict = tok.batch_encode_plus(["Hello my friends"], return_tensors="pt")
201
202 with torch.no_grad():
203 tiny(**inputs_dict)
204
205
206EN_CODE = 250004

Callers

nothing calls this directly

Calls 2

batch_encode_plusMethod · 0.80
from_pretrainedMethod · 0.45

Tested by

no test coverage detected