MCPcopy
hub / github.com/datalab-to/surya / to

Method to

surya/common/predictor.py:38–46  ·  view source on GitHub ↗
(self, device_dtype: torch.device | str | None = None)

Source from the content-addressed store, hash-verified

36 self._disable_tqdm = settings.DISABLE_TQDM
37
38 def to(self, device_dtype: torch.device | str | None = None):
39 if hasattr(self, "model") and self.model:
40 self.model.to(device_dtype)
41 return
42 # Predictors that don't own a torch model (e.g. VLM-backed predictors that
43 # rely on an external server) treat .to() as a no-op.
44 if hasattr(self, "manager") and self.manager is not None:
45 return
46 raise ValueError("Model not loaded")
47
48 def get_batch_size(self):
49 batch_size = self.batch_size

Callers 7

modelMethod · 0.45
forwardMethod · 0.45
modelMethod · 0.45
batch_detectionMethod · 0.45
_attnMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected