Zachary Greathouse commited on
Commit
e07c653
·
unverified ·
1 Parent(s): 92eaf0c

Update probability distribution for provider selection for comparison. (#23)

Browse files
Files changed (1) hide show
  1. 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
- - 50% HUME_AI, OPENAI
44
- - 25% OPENAI, ELEVENLABS
45
- - 20% HUME_AI, ELEVENLABS
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
- (HUME_AI, HUME_AI)
65
  ]
66
- weights = [0.5, 0.25, 0.2, 0.05]
67
-
68
- return random.choices(provider_pairs, weights=weights, k=1)[0]
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,