File tree Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -273,7 +273,7 @@ def _load(
273
273
vq_config = asdict (self .config .dvae .vq ),
274
274
dim = self .config .dvae .decoder .idim ,
275
275
coef = coef ,
276
- device = self . device ,
276
+ device = device ,
277
277
)
278
278
.to (device )
279
279
.eval ()
@@ -290,8 +290,8 @@ def _load(
290
290
self .config .embed .num_text_tokens ,
291
291
self .config .embed .num_vq ,
292
292
)
293
- embed .from_pretrained (embed_path , device = self . device )
294
- self .embed = embed .to (self . device )
293
+ embed .from_pretrained (embed_path , device = device )
294
+ self .embed = embed .to (device )
295
295
self .logger .log (logging .INFO , "embed loaded." )
296
296
297
297
gpt = GPT (
@@ -319,6 +319,7 @@ def _load(
319
319
decoder_config = asdict (self .config .decoder ),
320
320
dim = self .config .decoder .idim ,
321
321
coef = coef ,
322
+ device = device ,
322
323
)
323
324
.to (device )
324
325
.eval ()
Original file line number Diff line number Diff line change @@ -179,7 +179,7 @@ def __init__(
179
179
hop_length = 256 ,
180
180
n_mels = 100 ,
181
181
padding : Literal ["center" , "same" ] = "center" ,
182
- device : torch .device = torch .device ("cuda " ),
182
+ device : torch .device = torch .device ("cpu " ),
183
183
):
184
184
super ().__init__ ()
185
185
self .device = device
@@ -213,7 +213,7 @@ def __init__(
213
213
vq_config : Optional [dict ] = None ,
214
214
dim = 512 ,
215
215
coef : Optional [str ] = None ,
216
- device : torch .device = torch .device ("cuda " ),
216
+ device : torch .device = torch .device ("cpu " ),
217
217
):
218
218
super ().__init__ ()
219
219
if coef is None :
Original file line number Diff line number Diff line change 355
355
"metadata" : {},
356
356
"outputs" : [],
357
357
"source" : [
358
- " from tools.audio import load_audio\n " ,
358
+ " from ChatTTS. tools.audio import load_audio\n " ,
359
359
" \n " ,
360
360
" spk_smp = chat.sample_audio_speaker(load_audio(\" sample.mp3\" , 24000))\n " ,
361
361
" print(spk_smp) # save it in order to load the speaker without sample audio next time\n " ,
You can’t perform that action at this time.
0 commit comments