MCPcopy
hub / github.com/2noise/ChatTTS / load

Method load

ChatTTS/core.py:137–165  ·  view source on GitHub ↗
(
        self,
        source: Literal["huggingface", "local", "custom"] = "local",
        force_redownload=False,
        compile: bool = False,
        custom_path: Optional[FileLike] = None,
        device: Optional[torch.device] = None,
        coef: Optional[str] = None,
        use_flash_attn=False,
        use_vllm=False,
        experimental: bool = False,
        enable_cache=True,
    )

Source from the content-addressed store, hash-verified

135 return download_path
136
137 def load(
138 self,
139 source: Literal["huggingface", "local", "custom"] = "local",
140 force_redownload=False,
141 compile: bool = False,
142 custom_path: Optional[FileLike] = None,
143 device: Optional[torch.device] = None,
144 coef: Optional[str] = None,
145 use_flash_attn=False,
146 use_vllm=False,
147 experimental: bool = False,
148 enable_cache=True,
149 ) -> bool:
150 download_path = self.download_models(source, force_redownload, custom_path)
151 if download_path is None:
152 return False
153 return self._load(
154 device=device,
155 compile=compile,
156 coef=coef,
157 use_flash_attn=use_flash_attn,
158 use_vllm=use_vllm,
159 experimental=experimental,
160 enable_cache=enable_cache,
161 **{
162 k: os.path.join(download_path, v)
163 for k, v in asdict(self.config.path).items()
164 },
165 )
166
167 def unload(self):
168 logger = self.logger

Callers 12

mainFunction · 0.95
startup_eventFunction · 0.95
#655.pyFile · 0.80
#588.pyFile · 0.80
#511.pyFile · 0.80
stream.pyFile · 0.80
startup_eventFunction · 0.80
export_decoderFunction · 0.80
export_vocosFunction · 0.80
from_pretrainedMethod · 0.80
load_chatFunction · 0.80
_load_homophones_mapMethod · 0.80

Calls 2

download_modelsMethod · 0.95
_loadMethod · 0.95

Tested by

no test coverage detected