wasmdashai commited on
Commit
9dd92d9
·
verified ·
1 Parent(s): 9d3caf5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -129,11 +129,12 @@ def modelspeech(text=TXT,name_model="wasmdashai/vits-ar-sa-huba-v2",speaking_r
129
  model=get_model(name_model)
130
  model.speaking_rate=speaking_rate
131
  with torch.no_grad():
132
- wav=list(_inference_forward_stream(model,input_ids=inputs.input_ids,attention_mask=inputs.attention_mask,speaker_embeddings= None,is_streaming=False))[0]
133
  # with torch.no_grad():
134
  # wav = model(input_ids=inputs["input_ids"].cuda()).waveform.cpu().numpy().reshape(-1)#.detach()
135
 
136
- return (model.config.sampling_rate,wav)
 
137
 
138
  model_choices = gr.Dropdown(
139
  choices=[
 
129
  model=get_model(name_model)
130
  model.speaking_rate=speaking_rate
131
  with torch.no_grad():
132
+ wavs=_inference_forward_stream(model,input_ids=inputs.input_ids,attention_mask=inputs.attention_mask,speaker_embeddings= None,is_streaming=True)
133
  # with torch.no_grad():
134
  # wav = model(input_ids=inputs["input_ids"].cuda()).waveform.cpu().numpy().reshape(-1)#.detach()
135
 
136
+ for wav in wavs:
137
+ yield (model.config.sampling_rate,wav)
138
 
139
  model_choices = gr.Dropdown(
140
  choices=[