👍️[Update] Controller : add init progress
This commit is contained in:
@@ -1679,9 +1679,12 @@ class Controller:
|
||||
model.stopWatchdog()
|
||||
return {"status":200, "result":True}
|
||||
|
||||
def initializationProgress(self, progress):
|
||||
self.run(200, self.run_mapping["initialization_progress"], progress)
|
||||
|
||||
def init(self, *args, **kwargs) -> None:
|
||||
removeLog()
|
||||
printLog("Start Initialization")
|
||||
removeLog()
|
||||
|
||||
printLog("Start check DeepL API Key")
|
||||
if config.AUTH_KEYS["DeepL_API"] is not None:
|
||||
@@ -1691,6 +1694,8 @@ class Controller:
|
||||
auth_keys["DeepL_API"] = None
|
||||
config.AUTH_KEYS = auth_keys
|
||||
|
||||
self.initializationProgress(1)
|
||||
|
||||
# download CTranslate2 Model Weight
|
||||
printLog("Download CTranslate2 Model Weight")
|
||||
weight_type = config.CTRANSLATE2_WEIGHT_TYPE
|
||||
@@ -1714,6 +1719,8 @@ class Controller:
|
||||
if isinstance(th_download_whisper, Thread):
|
||||
th_download_whisper.join()
|
||||
|
||||
self.initializationProgress(2)
|
||||
|
||||
# set Translation Engine
|
||||
printLog("Set Translation Engine")
|
||||
self.updateDownloadedCTranslate2ModelWeight()
|
||||
@@ -1724,6 +1731,8 @@ class Controller:
|
||||
self.updateDownloadedWhisperModelWeight()
|
||||
self.updateTranscriptionEngine()
|
||||
|
||||
self.initializationProgress(3)
|
||||
|
||||
# set Compute CPU or CUDA
|
||||
printLog("Set Compute CPU or CUDA")
|
||||
self.updateComputeDeviceSettings()
|
||||
@@ -1748,6 +1757,7 @@ class Controller:
|
||||
self.setEnableVrcMicMuteSync()
|
||||
|
||||
# init Auto device selection
|
||||
printLog("Init Device Manager")
|
||||
device_manager.setCallbackHostList(self.updateMicHostList)
|
||||
device_manager.setCallbackMicDeviceList(self.updateMicDeviceList)
|
||||
device_manager.setCallbackSpeakerDeviceList(self.updateSpeakerDeviceList)
|
||||
@@ -1755,7 +1765,6 @@ class Controller:
|
||||
printLog("Init Auto Device Selection")
|
||||
if config.AUTO_MIC_SELECT is True:
|
||||
self.setEnableAutoMicSelect()
|
||||
|
||||
if config.AUTO_SPEAKER_SELECT is True:
|
||||
self.setEnableAutoSpeakerSelect()
|
||||
|
||||
@@ -1763,8 +1772,10 @@ class Controller:
|
||||
if (config.OVERLAY_SMALL_LOG is True or config.OVERLAY_LARGE_LOG is True):
|
||||
model.startOverlay()
|
||||
|
||||
self.initializationProgress(4)
|
||||
|
||||
printLog("Update settings")
|
||||
self.updateConfigSettings()
|
||||
|
||||
printLog("End Initialization")
|
||||
|
||||
self.startWatchdog()
|
||||
@@ -37,6 +37,7 @@ run_mapping = {
|
||||
|
||||
"update_software_flag":"/run/update_software_flag",
|
||||
|
||||
"initialization_progress":"/run/initialization_progress",
|
||||
"initialization_complete":"/run/initialization_complete",
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user