Only load the model if needed.
(self)
| 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.") |
no test coverage detected