mirror of
https://github.com/2noise/ChatTTS.git
synced 2026-08-29 02:10:59 +08:00
chore: restore some latest changes
This commit is contained in:
@@ -535,6 +535,16 @@ class Chat:
|
||||
)
|
||||
start_idx = input_ids.shape[-2]
|
||||
|
||||
if not gpt.is_vllm:
|
||||
emb = gpt(input_ids, text_mask)
|
||||
|
||||
del text_mask
|
||||
|
||||
if params.spk_emb is not None:
|
||||
self.tokenizer.apply_spk_emb(
|
||||
emb, params.spk_emb, input_ids, self.gpt.device_gpt
|
||||
)
|
||||
|
||||
num_code = self.config.gpt.num_audio_tokens - 1
|
||||
|
||||
logits_warpers, logits_processors = gen_logits(
|
||||
@@ -603,6 +613,12 @@ class Chat:
|
||||
repetition_penalty=params.repetition_penalty,
|
||||
)
|
||||
|
||||
if not gpt.is_vllm:
|
||||
|
||||
emb = gpt(input_ids, text_mask)
|
||||
|
||||
del text_mask
|
||||
|
||||
sample_params = SamplingParams(
|
||||
temperature=params.temperature,
|
||||
max_new_token=params.max_new_token,
|
||||
|
||||
@@ -44,6 +44,7 @@ class GPT(nn.Module):
|
||||
|
||||
self.gpt, self.llama_config = self._build_llama(gpt_config, self.device_gpt)
|
||||
self.is_te_llama = False
|
||||
self.is_vllm = False
|
||||
self.model_dim = int(self.gpt.config.hidden_size)
|
||||
self.emb_code = nn.ModuleList(
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user