End to end connected for demo #17
@@ -5,12 +5,13 @@ from control_backend.agents.transcription.speech_recognizer import OpenAIWhisper
|
|||||||
|
|
||||||
|
|
||||||
def test_estimate_max_tokens():
|
def test_estimate_max_tokens():
|
||||||
"""Inputting one minute of audio, assuming 300 words per minute, expecting 400 tokens."""
|
"""Inputting one minute of audio, assuming 450 words per minute and adding a 10 token padding,
|
||||||
|
expecting 610 tokens."""
|
||||||
audio = np.empty(shape=(60 * 16_000), dtype=np.float32)
|
audio = np.empty(shape=(60 * 16_000), dtype=np.float32)
|
||||||
|
|
||||||
actual = SpeechRecognizer._estimate_max_tokens(audio)
|
actual = SpeechRecognizer._estimate_max_tokens(audio)
|
||||||
|
|
||||||
assert actual == 400
|
assert actual == 610
|
||||||
assert isinstance(actual, int)
|
assert isinstance(actual, int)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user