chore: restore some latest changes

This commit is contained in:
源文雨
2024-07-24 00:36:01 +08:00
parent 5a29d8e51c
commit cc8024a399
2 changed files with 17 additions and 0 deletions
+16
View File
@@ -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,
+1
View File
@@ -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(
[