Skip to content

Commit 616b3ef

Browse files
committed
added long-form test case
1 parent 8fe2c66 commit 616b3ef

File tree

1 file changed

+38
-2
lines changed

1 file changed

+38
-2
lines changed

packages/audio/xtts/test_stream.py

+38-2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,42 @@
5353

5454
prompts = [' '.join(prompts)] + prompts
5555

56+
long_prompt = """French onion soup is a classic and delicious dish that is easy to make at home. Here's a simple recipe for French onion soup that you can try:
57+
58+
Ingredients:
59+
60+
* 1 onion, 1/4 cup, chopped
61+
* 2 tablespoons butter
62+
* 1/4 cup white wine (optional)
63+
* 4 cups beef broth
64+
* 2 tablespoons tomato paste
65+
* 1 teaspoon dried thyme
66+
* 1/2 teaspoon dried oregano
67+
* 1/2 teaspoon salt
68+
* 1/4 teaspoon black pepper
69+
* 2 tablespoons all-purpose flour
70+
* 2 tablespoons butter
71+
* 1/2 cup grated Gruyère cheese
72+
* 1/2 cup grated Swiss cheese
73+
* 1/4 cup chopped fresh parsley
74+
75+
Instructions:
76+
77+
1. Heat 2 tablespoons of butter in a large saucepan over medium heat.
78+
2. Add the chopped onion and cook until it is softened and translucent, about 5 minutes.
79+
3. Add the white wine (if using) and 4 cups of beef broth to the saucepan. Bring to a boil, then reduce the heat to low and let it simmer for 10 minutes.
80+
4. In a small bowl, mix the tomato paste, thyme, oregano, salt, and pepper.
81+
5. Stir the tomato paste mixture into the broth and let it simmer for 5 more minutes.
82+
6. In a small bowl, mix the flour and 2 tablespoons of butter.
83+
7. Stir the flour mixture into the broth and let it cook for 1-2 minutes, or until the soup thickens.
84+
8. Stir in the Gruyère and Swiss cheese, and let it melt and thicken the soup.
85+
9. Taste and adjust the seasoning as needed.
86+
10. Serve the French onion soup hot, garnished with chopped fresh parsley and a side of crusty bread or a salad.
87+
88+
Enjoy your"""
89+
90+
#prompts = [long_prompt[:500]]
91+
5692
for prompt_idx, prompt in enumerate(prompts):
5793
wav_path = f"/data/audio/tts/{model_name}_streaming_{speaker.lower().replace(' ', '_')}_{prompt_idx}.wav"
5894
logging.info(f'\nstreaming "{prompt}" speaker="{speaker}" lang="{language}" wav="{wav_path}"\n')
@@ -66,9 +102,9 @@
66102
gpt_cond_latent,
67103
speaker_embedding,
68104
enable_text_splitting=False, #True,
69-
overlap_len=128,
105+
#overlap_len=128,
70106
#stream_chunk_size=20,
71-
do_sample=False,
107+
#do_sample=False,
72108
speed=0.9,
73109
)
74110

0 commit comments

Comments
 (0)