Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gpt): stream mode dim mismatch (fix #606) #607

Merged
merged 1 commit into from
Jul 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading