forked from locaal-ai/lexisynth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
models_info.py
47 lines (41 loc) · 1.72 KB
/
models_info.py
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
35
36
37
38
39
40
41
42
43
44
45
46
47
from os import path
from platformdirs import user_data_dir
class ModelDownloadInfo:
# URLs for downloading the models
M2M_100 = {
"url": "https://lexistream-downloads.s3.amazonaws.com/m2m_100_418M-ct2-int8.zip",
"file_name": "m2m_100_418M-ct2-int8.zip",
"model_folder_name": "M2M-100",
"model_name": "M2M-100",
}
FASTER_WHISPER_TINY_CT2 = {
"url": "https://lexistream-downloads.s3.amazonaws.com/faster-whisper-tiny-ct2-int8.zip",
"file_name": "faster-whisper-tiny-ct2-int8.zip",
"model_folder_name": "Faster-Whisper-Tiny-CT2",
"model_name": "Faster-Whisper Tiny",
}
FASTER_WHISPER_BASE_CT2 = {
"url": "https://lexistream-downloads.s3.amazonaws.com/faster-whisper-base-ct2-int8.zip",
"file_name": "faster-whisper-base-ct2-int8.zip",
"model_folder_name": "Faster-Whisper-Base-CT2",
"model_name": "Faster-Whisper Base",
}
FASTER_WHISPER_SMALL_CT2 = {
"url": "https://lexistream-downloads.s3.amazonaws.com/faster-whisper-small-ct2-int8.zip",
"file_name": "faster-whisper-small-ct2-int8.zip",
"model_folder_name": "Faster-Whisper-Small-CT2",
"model_name": "Faster-Whisper Small",
}
def checkForModelDownload(modelInfo):
# check if the model has been downloaded to the data dir
data_dir = user_data_dir("lexisynth")
if not path.exists(data_dir):
return False
model_dir = path.join(data_dir, modelInfo["model_folder_name"])
if not path.exists(model_dir):
return False
return True
def getAbsoluteModelPath(modelInfo):
# get the absolute path to the model
data_dir = user_data_dir("lexisynth")
return path.join(data_dir, modelInfo["model_folder_name"])