mirror of
https://github.com/FunAudioLLM/CosyVoice.git
synced 2026-02-05 01:49:25 +08:00
fix bug
This commit is contained in:
@@ -21,7 +21,7 @@ from cosyvoice.utils.file_utils import logging
|
||||
|
||||
class CosyVoice:
|
||||
|
||||
def __init__(self, model_dir, load_jit=True, load_trt=False, use_fp16=False):
|
||||
def __init__(self, model_dir, load_jit=True, load_trt=True, use_fp16=False):
|
||||
instruct = True if '-Instruct' in model_dir else False
|
||||
self.model_dir = model_dir
|
||||
if not os.path.exists(model_dir):
|
||||
@@ -39,7 +39,7 @@ class CosyVoice:
|
||||
self.model.load('{}/llm.pt'.format(model_dir),
|
||||
'{}/flow.pt'.format(model_dir),
|
||||
'{}/hift.pt'.format(model_dir))
|
||||
load_jit = False
|
||||
|
||||
if load_jit:
|
||||
self.model.load_jit('{}/llm.text_encoder.fp16.zip'.format(model_dir),
|
||||
'{}/llm.llm.fp16.zip'.format(model_dir))
|
||||
|
||||
@@ -83,7 +83,8 @@ class CosyVoiceModel:
|
||||
with open(trt_file_path, 'rb') as f:
|
||||
serialized_engine = f.read()
|
||||
engine = runtime.deserialize_cuda_engine(serialized_engine)
|
||||
self.flow.decoder.estimator = engine.create_execution_context()
|
||||
self.flow.decoder.estimator_context = engine.create_execution_context()
|
||||
self.flow.decoder.estimator = None
|
||||
|
||||
def llm_job(self, text, prompt_text, llm_prompt_speech_token, llm_embedding, uuid):
|
||||
with self.llm_context:
|
||||
|
||||
Reference in New Issue
Block a user