Spaces:
Running
Running
Zachary Greathouse commited on
Update probability distribution for provider selection for comparison. (#23)
Browse files- src/core/tts_service.py +7 -9
src/core/tts_service.py
CHANGED
|
@@ -40,10 +40,9 @@ class TTSService:
|
|
| 40 |
Select 2 TTS providers based on whether the text has been modified.
|
| 41 |
|
| 42 |
Probabilities:
|
| 43 |
-
-
|
| 44 |
-
-
|
| 45 |
-
-
|
| 46 |
-
- 5% HUME_AI, HUME_AI
|
| 47 |
|
| 48 |
If the `text_modified` argument is `True`, then 100% HUME_AI, HUME_AI
|
| 49 |
|
|
@@ -59,13 +58,12 @@ class TTSService:
|
|
| 59 |
# When modifying the probability distribution, make sure the weights match the order of provider pairs
|
| 60 |
provider_pairs = [
|
| 61 |
(HUME_AI, OPENAI),
|
| 62 |
-
(OPENAI, ELEVENLABS),
|
| 63 |
(HUME_AI, ELEVENLABS),
|
| 64 |
-
(
|
| 65 |
]
|
| 66 |
-
weights = [
|
| 67 |
-
|
| 68 |
-
return
|
| 69 |
|
| 70 |
async def synthesize_speech(
|
| 71 |
self,
|
|
|
|
| 40 |
Select 2 TTS providers based on whether the text has been modified.
|
| 41 |
|
| 42 |
Probabilities:
|
| 43 |
+
- 1/3 HUME_AI & OPENAI
|
| 44 |
+
- 1/3 HUME_AI & ELEVENLABS
|
| 45 |
+
- 1/3 OPENAI & ELEVENLABS
|
|
|
|
| 46 |
|
| 47 |
If the `text_modified` argument is `True`, then 100% HUME_AI, HUME_AI
|
| 48 |
|
|
|
|
| 58 |
# When modifying the probability distribution, make sure the weights match the order of provider pairs
|
| 59 |
provider_pairs = [
|
| 60 |
(HUME_AI, OPENAI),
|
|
|
|
| 61 |
(HUME_AI, ELEVENLABS),
|
| 62 |
+
(OPENAI, ELEVENLABS),
|
| 63 |
]
|
| 64 |
+
weights = [1, 1, 1]
|
| 65 |
+
selected_pair = random.choices(provider_pairs, weights=weights, k=1)[0]
|
| 66 |
+
return selected_pair
|
| 67 |
|
| 68 |
async def synthesize_speech(
|
| 69 |
self,
|