Skip to content

Commit

Permalink
fix(gpt): stream mode dim mismatch (fix #606)
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Jul 20, 2024
1 parent a0e6cd8 commit 499c294
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ChatTTS/model/gpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ def generate(
)
inputs_ids_buf.narrow(1, 0, progress).copy_(inputs_ids)
del inputs_ids
inputs_ids = inputs_ids_buf.narrow(1, 0, progress)

pbar: Optional[tqdm] = None

Expand All @@ -430,8 +431,6 @@ def generate(

for i in range(max_new_token):

inputs_ids = inputs_ids_buf.narrow(1, 0, progress)

model_input = self._prepare_generation_inputs(
inputs_ids,
past_key_values,
Expand Down Expand Up @@ -606,6 +605,7 @@ def generate(

del idx_next
progress += 1
inputs_ids = inputs_ids_buf.narrow(1, 0, progress)

not_finished = finish.logical_not().to(end_idx.device)
end_idx.add_(not_finished.int())
Expand Down

0 comments on commit 499c294

Please sign in to comment.