[WIP/TEST] Config : USE_RECOGNIZER_FEATURE -> USE_WHISPER_FEATURE
This commit is contained in:
19
config.py
19
config.py
@@ -584,14 +584,14 @@ class Config:
|
||||
saveJson(self.PATH_CONFIG, inspect.currentframe().f_code.co_name, value)
|
||||
|
||||
@property
|
||||
@json_serializable('USE_RECOGNIZER_FEATURE')
|
||||
def USE_RECOGNIZER_FEATURE(self):
|
||||
return self._USE_RECOGNIZER_FEATURE
|
||||
@json_serializable('USE_WHISPER_FEATURE')
|
||||
def USE_WHISPER_FEATURE(self):
|
||||
return self._USE_WHISPER_FEATURE
|
||||
|
||||
@USE_RECOGNIZER_FEATURE.setter
|
||||
def USE_RECOGNIZER_FEATURE(self, value):
|
||||
@USE_WHISPER_FEATURE.setter
|
||||
def USE_WHISPER_FEATURE(self, value):
|
||||
if isinstance(value, bool):
|
||||
self._USE_RECOGNIZER_FEATURE = value
|
||||
self._USE_WHISPER_FEATURE = value
|
||||
saveJson(self.PATH_CONFIG, inspect.currentframe().f_code.co_name, value)
|
||||
|
||||
@property
|
||||
@@ -797,17 +797,12 @@ class Config:
|
||||
self._SELECTABLE_WHISPER_WEIGHT_TYPE_DICT = {
|
||||
# {Save json str}: {i18n_placeholder} pairs
|
||||
"tiny": "tiny",
|
||||
"tiny.en": "tiny.en",
|
||||
"base": "base",
|
||||
"base.en": "base.en",
|
||||
"small": "small",
|
||||
"small.en": "small.en",
|
||||
"medium": "medium",
|
||||
"medium.en": "medium.en",
|
||||
"large-v1": "large-v1",
|
||||
"large-v2": "large-v2",
|
||||
"large-v3": "large-v3",
|
||||
"large": "large",
|
||||
}
|
||||
|
||||
self._MAX_MIC_ENERGY_THRESHOLD = 2000
|
||||
@@ -887,7 +882,7 @@ class Config:
|
||||
}
|
||||
self._USE_TRANSLATION_FEATURE = True
|
||||
self._CTRANSLATE2_WEIGHT_TYPE = "Small"
|
||||
self._USE_RECOGNIZER_FEATURE = True
|
||||
self._USE_WHISPER_FEATURE = True
|
||||
self._WHISPER_WEIGHT_TYPE = "base"
|
||||
self._SEND_MESSAGE_FORMAT = "[message]"
|
||||
self._SEND_MESSAGE_FORMAT_WITH_T = "[message]([translation])"
|
||||
|
||||
2
main.py
2
main.py
@@ -14,7 +14,7 @@ if __name__ == "__main__":
|
||||
splash.toProgress(0)
|
||||
|
||||
# whisperのダウンロードの説明に変更する必要あり
|
||||
if config.USE_RECOGNIZER_FEATURE is True:
|
||||
if config.USE_WHISPER_FEATURE is True:
|
||||
from models.transcription.transcription_whisper import downloadWhisperWeight
|
||||
downloadWhisperWeight(config.PATH_LOCAL, config.WHISPER_WEIGHT_TYPE, splash.updateDownloadProgress)
|
||||
splash.toProgress(0)
|
||||
|
||||
4
model.py
4
model.py
@@ -335,7 +335,7 @@ class Model:
|
||||
source=self.mic_audio_recorder.source,
|
||||
phrase_timeout=phase_timeout,
|
||||
max_phrases=config.INPUT_MIC_MAX_PHRASES,
|
||||
whisper_enabled=config.USE_RECOGNIZER_FEATURE,
|
||||
whisper_enabled=config.USE_WHISPER_FEATURE,
|
||||
whisper_weight_type=config.WHISPER_WEIGHT_TYPE,
|
||||
root=config.PATH_LOCAL,
|
||||
)
|
||||
@@ -419,7 +419,7 @@ class Model:
|
||||
source=self.speaker_audio_recorder.source,
|
||||
phrase_timeout=phase_timeout,
|
||||
max_phrases=config.INPUT_SPEAKER_MAX_PHRASES,
|
||||
whisper_enabled=config.USE_RECOGNIZER_FEATURE,
|
||||
whisper_enabled=config.USE_WHISPER_FEATURE,
|
||||
whisper_weight_type=config.WHISPER_WEIGHT_TYPE,
|
||||
root=config.PATH_LOCAL,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user