burraco135 commited on
Commit
5b52d90
1 Parent(s): 6be449f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -10,15 +10,15 @@ processor = SpeechT5Processor.from_pretrained(checkpoint)
10
  model = SpeechT5ForTextToSpeech.from_pretrained(checkpoint)
11
  vocoder = SpeechT5Processor.from_pretrained("microsoft/speecht5_tts")
12
 
13
- speaker_embedding = "speaker_0_embeddings.npy"
14
-
15
  def predict(text, speaker):
16
 
 
 
17
  inputs = processor(text=text, return_tensors="pt")
18
 
19
- # limit input length
20
- input_ids = inputs["input_ids"]
21
- input_ids = input_ids[..., :model.config.max_text_positions]
22
 
23
  speaker_embedding = torch.tensor(speaker_embedding).unsqueeze(0)
24
 
 
10
  model = SpeechT5ForTextToSpeech.from_pretrained(checkpoint)
11
  vocoder = SpeechT5Processor.from_pretrained("microsoft/speecht5_tts")
12
 
 
 
13
  def predict(text, speaker):
14
 
15
+ speaker_embedding = "speaker_0_embeddings.npy"
16
+
17
  inputs = processor(text=text, return_tensors="pt")
18
 
19
+ # # limit input length
20
+ # input_ids = inputs["input_ids"]
21
+ # input_ids = input_ids[..., :model.config.max_text_positions]
22
 
23
  speaker_embedding = torch.tensor(speaker_embedding).unsqueeze(0)
24