Spaces:
Runtime error
Runtime error
ASG Models
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -127,7 +127,7 @@ def generate_audio(text,name_model,speaker_id=None):
|
|
| 127 |
model=get_model(name_model)
|
| 128 |
#torch.cuda.empty_cache()
|
| 129 |
with torch.no_grad():
|
| 130 |
-
for chunk in _inference_forward_stream(model,input_ids=inputs.input_ids,attention_mask=inputs.attention_mask,speaker_embeddings= speaker_embeddings,chunk_size=
|
| 131 |
yield 16000,chunk#.squeeze().cpu().numpy()#.astype(np.int16).tobytes()
|
| 132 |
def generate_audio_ai(text,name_model):
|
| 133 |
text_answer = get_answer_ai(text)
|
|
@@ -138,7 +138,7 @@ def generate_audio_ai(text,name_model):
|
|
| 138 |
model=get_model(name_model)
|
| 139 |
#torch.cuda.empty_cache()
|
| 140 |
with torch.no_grad():
|
| 141 |
-
for chunk in _inference_forward_stream(model,input_ids=inputs.input_ids,attention_mask=inputs.attention_mask,speaker_embeddings= speaker_embeddings,chunk_size=
|
| 142 |
yield 16000,chunk#.cpu().numpy().squeeze()#.astype(np.int16).tobytes()
|
| 143 |
|
| 144 |
# yield generate_audio(text_answer,name_model)
|
|
|
|
| 127 |
model=get_model(name_model)
|
| 128 |
#torch.cuda.empty_cache()
|
| 129 |
with torch.no_grad():
|
| 130 |
+
for chunk in _inference_forward_stream(model,input_ids=inputs.input_ids,attention_mask=inputs.attention_mask,speaker_embeddings= speaker_embeddings,chunk_size=256):
|
| 131 |
yield 16000,chunk#.squeeze().cpu().numpy()#.astype(np.int16).tobytes()
|
| 132 |
def generate_audio_ai(text,name_model):
|
| 133 |
text_answer = get_answer_ai(text)
|
|
|
|
| 138 |
model=get_model(name_model)
|
| 139 |
#torch.cuda.empty_cache()
|
| 140 |
with torch.no_grad():
|
| 141 |
+
for chunk in _inference_forward_stream(model,input_ids=inputs.input_ids,attention_mask=inputs.attention_mask,speaker_embeddings= speaker_embeddings,chunk_size=256):
|
| 142 |
yield 16000,chunk#.cpu().numpy().squeeze()#.astype(np.int16).tobytes()
|
| 143 |
|
| 144 |
# yield generate_audio(text_answer,name_model)
|