Spaces:
Sleeping
Sleeping
Commit
·
f3f7cbd
1
Parent(s):
ecf9f6f
Add code
Browse files
app.py
CHANGED
@@ -213,18 +213,14 @@ def generate_base(subject, setting):
|
|
213 |
|
214 |
model_input = story.replace("\n", " ").strip()
|
215 |
model_input_tokens = nltk.sent_tokenize(model_input)
|
216 |
-
model_input_token_pairs = []
|
217 |
-
for i in range(0, len(model_input_tokens), 2):
|
218 |
-
model_input_token_pairs.append(" ".join(model_input_tokens[i:(i + 2)]))
|
219 |
|
220 |
-
|
221 |
-
play_steps_in_s = 5.0
|
222 |
play_steps = int(frame_rate * play_steps_in_s)
|
223 |
|
224 |
description = "Jenny speaks at an average pace with a calm delivery in a very confined sounding environment with clear audio quality."
|
225 |
description_tokens = tokenizer(description, return_tensors="pt").to(device)
|
226 |
|
227 |
-
for i, sentence in enumerate(
|
228 |
streamer = ParlerTTSStreamer(model, device=device, play_steps=play_steps)
|
229 |
print("SENTENCE", sentence)
|
230 |
prompt = tokenizer(sentence, return_tensors="pt").to(device)
|
|
|
213 |
|
214 |
model_input = story.replace("\n", " ").strip()
|
215 |
model_input_tokens = nltk.sent_tokenize(model_input)
|
|
|
|
|
|
|
216 |
|
217 |
+
play_steps_in_s = 3.0
|
|
|
218 |
play_steps = int(frame_rate * play_steps_in_s)
|
219 |
|
220 |
description = "Jenny speaks at an average pace with a calm delivery in a very confined sounding environment with clear audio quality."
|
221 |
description_tokens = tokenizer(description, return_tensors="pt").to(device)
|
222 |
|
223 |
+
for i, sentence in enumerate(model_input_tokens):
|
224 |
streamer = ParlerTTSStreamer(model, device=device, play_steps=play_steps)
|
225 |
print("SENTENCE", sentence)
|
226 |
prompt = tokenizer(sentence, return_tensors="pt").to(device)
|