File size: 950 Bytes
0065413
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import os

def check_fw_local_models():
    '''

    启动时检查本地是否有 Faster Whisper 模型.

    '''
    model_size_list = [
        "tiny",     "tiny.en", 
        "base",     "base.en", 
        "small",    "small.en", 
        "medium",   "medium.en", 
        "large",    "large-v1", 
        "large-v2", "large-v3"]
    for i, size in enumerate(model_size_list):
        if os.path.exists(f'tools/asr/models/faster-whisper-{size}'):
            model_size_list[i] = size + '-local'
    return model_size_list

asr_dict = {
    "达摩 ASR (中文)": {
        'lang': ['zh'],
        'size': ['large'],
        'path': 'funasr_asr.py',
        'precision': ['float32']
    },
    "Faster Whisper (多语种)": {
        'lang': ['auto', 'zh', 'en', 'ja'],
        'size': check_fw_local_models(),
        'path': 'fasterwhisper_asr.py',
        'precision': ['float32', 'float16', 'int8']
    },
}