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

Method model

tests/test_modeling_bart.py:230–235  ·  view source on GitHub ↗

Only load the model if needed.

(self)

Source from the content-addressed store, hash-verified

228
229 @cached_property
230 def model(self):
231 """Only load the model if needed."""
232 model = AutoModelForSeq2SeqLM.from_pretrained("facebook/mbart-large-en-ro").to(torch_device)
233 if "cuda" in torch_device:
234 model = model.half()
235 return model
236
237 @slow
238 @unittest.skip("This has been failing since June 20th at least.")

Callers 15

infer_shapesFunction · 0.45
forwardMethod · 0.45
forwardMethod · 0.45
forwardMethod · 0.45
_forwardMethod · 0.45
__call__Method · 0.45
__call__Method · 0.45
_run_modelMethod · 0.45
convert_bart_checkpointFunction · 0.45
forwardMethod · 0.45
forwardMethod · 0.45

Calls 2

toMethod · 0.80
from_pretrainedMethod · 0.45

Tested by

no test coverage detected