Tejasva-Maurya commited on
Commit
c3d0a4b
1 Parent(s): 3eab330

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -50,7 +50,7 @@ try:
50
 
51
  # Prepare the dataset
52
  dataset = dataset.map(prepare_dataset, remove_columns=dataset.column_names)
53
- example = dataset[10]
54
  speaker_embeddings = torch.tensor(example["speaker_embeddings"]).unsqueeze(0)
55
 
56
  except Exception as e:
@@ -149,11 +149,10 @@ def text_preprocessing(text):
149
  text = ' '.join(text.split())
150
  for src, dst in replacements:
151
  text = text.replace(src, dst)
152
- return text
153
 
154
- inputs = processor(text=text, return_tensors="pt")
155
- speech = model.generate_speech(inputs["input_ids"], speaker_embedding, vocoder=vocoder)
156
- return (16000, speech.numpy())
157
 
158
  iface = gr.Interface(
159
  fn=text_to_speech,
 
50
 
51
  # Prepare the dataset
52
  dataset = dataset.map(prepare_dataset, remove_columns=dataset.column_names)
53
+ example = dataset[5]
54
  speaker_embeddings = torch.tensor(example["speaker_embeddings"]).unsqueeze(0)
55
 
56
  except Exception as e:
 
149
  text = ' '.join(text.split())
150
  for src, dst in replacements:
151
  text = text.replace(src, dst)
 
152
 
153
+ inputs = processor(text=text, return_tensors="pt")
154
+ speech = model.generate_speech(inputs["input_ids"], speaker_embedding, vocoder=vocoder)
155
+ return (16000, speech.numpy())
156
 
157
  iface = gr.Interface(
158
  fn=text_to_speech,