Update app.py
Browse files
app.py
CHANGED
@@ -107,12 +107,12 @@ async def tts(ws: WebSocket):
|
|
107 |
buf = []
|
108 |
|
109 |
while True:
|
110 |
-
next_cache_pos = torch.tensor([
|
111 |
gen = model.generate(
|
112 |
input_ids = ids if past is None else torch.tensor([[last_tok]], device=device),
|
113 |
attention_mask = attn if past is None else None,
|
114 |
past_key_values = past,
|
115 |
-
cache_position =
|
116 |
max_new_tokens = CHUNK_TOKENS,
|
117 |
logits_processor=[masker],
|
118 |
do_sample=True, temperature=0.7, top_p=0.95,
|
|
|
107 |
buf = []
|
108 |
|
109 |
while True:
|
110 |
+
next_cache_pos = torch.tensor([past.get_seq_length()], device=device)
|
111 |
gen = model.generate(
|
112 |
input_ids = ids if past is None else torch.tensor([[last_tok]], device=device),
|
113 |
attention_mask = attn if past is None else None,
|
114 |
past_key_values = past,
|
115 |
+
cache_position = next_cache_pos,
|
116 |
max_new_tokens = CHUNK_TOKENS,
|
117 |
logits_processor=[masker],
|
118 |
do_sample=True, temperature=0.7, top_p=0.95,
|