MCPcopy
hub / github.com/OpenBMB/VoxCPM / get_dtype

Function get_dtype

src/voxcpm/model/utils.py:125–139  ·  view source on GitHub ↗
(dtype: str)

Source from the content-addressed store, hash-verified

123
124
125def get_dtype(dtype: str):
126 if dtype == "bfloat16":
127 return torch.bfloat16
128 elif dtype == "bf16":
129 return torch.bfloat16
130 elif dtype == "float16":
131 return torch.float16
132 elif dtype == "fp16":
133 return torch.float16
134 elif dtype == "float32":
135 return torch.float32
136 elif dtype == "fp32":
137 return torch.float32
138 else:
139 raise ValueError(f"Unsupported dtype: {dtype}")
140
141
142def _has_mps() -> bool:

Callers 11

__init__Method · 0.85
_dtypeMethod · 0.85
_generateMethod · 0.85
from_localMethod · 0.85
__init__Method · 0.85
_dtypeMethod · 0.85
_generateMethod · 0.85
from_localMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…