File size: 572 Bytes
88e3f4a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import pytest

from omniff.models.chunked_asr import ChunkedASRModel


def test_chunked_asr_interface():
    model = ChunkedASRModel()
    assert not model.is_loaded
    assert model.chunk_length_s == 30.0


def test_chunked_asr_not_loaded():
    model = ChunkedASRModel()
    with pytest.raises(RuntimeError, match="not loaded"):
        model.infer({"audio_path": "test.wav"})


def test_chunked_asr_stream_not_loaded():
    model = ChunkedASRModel()
    with pytest.raises(RuntimeError, match="not loaded"):
        list(model.infer_stream({"audio_path": "test.wav"}))