diff --git a/locales/en.yml b/locales/en.yml index e96de8fb..25b04e62 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -179,8 +179,10 @@ config_page: desc: "Larger models have higher accuracy, but they also consume more CPU or GPU resources.\nEspecially for models larger than medium, it may be difficult or even impossible to use them depending on the performance of your CPU/GPU." model_template: "{{model_name}} model ({{capacity}})" recommended_model_template: "{{model_name}} model ({{capacity}}) (Recommended)" - whisper_compute_device: - label: "Processing Device Used For Whisper" + whisper_compute_type: + label: "Processing type for AI transcription {{whisper}}" + transcription_compute_device: + label: "Processing Device Used For AI transcription" vr: single_line: "Single line" diff --git a/locales/ja.yml b/locales/ja.yml index a16b6b1d..39542767 100644 --- a/locales/ja.yml +++ b/locales/ja.yml @@ -179,8 +179,10 @@ config_page: desc: "容量が大きいモデルほど精度は高いですが、その分CPUやGPUを占有します。\n※特にmediumより容量の大きいモデルは、CPU/GPUの性能によっては使用すらも困難です。" model_template: "{{model_name}} モデル ({{capacity}})" recommended_model_template: "{{model_name}} モデル ({{capacity}}) [推奨]" - whisper_compute_device: - label: "Whisperで使用する処理デバイス" + whisper_compute_type: + label: "AI音声認識 {{whisper}} の処理タイプ" + transcription_compute_device: + label: "AI音声認識で使用する処理デバイス" vr: single_line: "一行" diff --git a/locales/ko.yml b/locales/ko.yml index df188d5f..288c63e3 100644 --- a/locales/ko.yml +++ b/locales/ko.yml @@ -179,8 +179,10 @@ config_page: desc: "용량이 큰 모델일수록 정확도는 높지만, 그만큼 CPU나 GPU를 많이 차지합니다. * 특히 medium보다 용량이 큰 모델은 CPU/GPU 성능에 따라 사용 자체가 어려울 수 있습니다." model_template: "{{model_name}} 모델 ({{capacity}})" recommended_model_template: "{{model_name}} 모델 ({{capacity}}) (권장)" - whisper_compute_device: - label: "Whisper에서 사용할 처리 장치" + whisper_compute_type: + label: + transcription_compute_device: + label: vr: single_line: "한 줄" diff --git a/locales/zh-Hans.yml b/locales/zh-Hans.yml index e2bd4a14..7cfc594e 100644 --- a/locales/zh-Hans.yml +++ b/locales/zh-Hans.yml @@ -179,7 +179,9 @@ config_page: desc: model_template: "{{model_name}} 模型 ({{capacity}})" recommended_model_template: "{{model_name}} 模型 ({{capacity}}) (推荐)" - whisper_compute_device: + whisper_compute_type: + label: + transcription_compute_device: label: vr: diff --git a/locales/zh-Hant.yml b/locales/zh-Hant.yml index bc190b25..039b60ba 100644 --- a/locales/zh-Hant.yml +++ b/locales/zh-Hant.yml @@ -179,7 +179,9 @@ config_page: desc: model_template: "{{model_name}}模型({{capacity}})" recommended_model_template: "{{model_name}}模型({{capacity}})(推薦)" - whisper_compute_device: + whisper_compute_type: + label: + transcription_compute_device: label: vr: diff --git a/src-ui/app/config_page/setting_section/setting_box/transcription/Transcription.jsx b/src-ui/app/config_page/setting_section/setting_box/transcription/Transcription.jsx index 7416c970..2e0daf92 100644 --- a/src-ui/app/config_page/setting_section/setting_box/transcription/Transcription.jsx +++ b/src-ui/app/config_page/setting_section/setting_box/transcription/Transcription.jsx @@ -201,7 +201,8 @@ const TranscriptionEngine_Container = () => { - + + ); }; @@ -274,46 +275,70 @@ const WhisperWeightType_Box = () => { ); }; +const WhisperComputeType_Box = () => { + const { t } = useI18n(); + const { currentSelectableWhisperComputeTypeList } = useTranscription(); + const { currentSelectedWhisperComputeType, setSelectedWhisperComputeType } = useTranscription(); + + const selectFunction = (selected_data) => { + setSelectedWhisperComputeType(selected_data.selected_id); + }; + + const whisper_compute_type_label = t("config_page.transcription.whisper_compute_type.label", { + whisper: "Whisper" + }); + + return ( + + ); +}; // Duplicate import { useComputeMode } from "@logics_common"; -const WhisperComputeDevice_Box = () => { +const TranscriptionComputeDevice_Box = () => { const { t } = useI18n(); - const { currentSelectedWhisperComputeDevice, setSelectedWhisperComputeDevice } = useTranscription(); - const { currentSelectableWhisperComputeDeviceList } = useTranscription(); + const { currentSelectedTranscriptionComputeDevice, setSelectedTranscriptionComputeDevice } = useTranscription(); + const { currentSelectableTranscriptionComputeDeviceList } = useTranscription(); const selectFunction = (selected_data) => { - const target_obj = currentSelectableWhisperComputeDeviceList.data[selected_data.selected_id]; - setSelectedWhisperComputeDevice(target_obj); + const target_obj = currentSelectableTranscriptionComputeDeviceList.data[selected_data.selected_id]; + setSelectedTranscriptionComputeDevice(target_obj); }; - const list_for_ui = transformDeviceArray(currentSelectableWhisperComputeDeviceList.data); + const list_for_ui = transformDeviceArray(currentSelectableTranscriptionComputeDeviceList.data); - const target_index = findKeyByDeviceValue(currentSelectableWhisperComputeDeviceList.data, currentSelectedWhisperComputeDevice.data); + const target_index = findKeyByDeviceValue(currentSelectableTranscriptionComputeDeviceList.data, currentSelectedTranscriptionComputeDevice.data); const { currentComputeMode } = useComputeMode(); if (currentComputeMode.data === "cpu") { return ( ) } return ( ); }; diff --git a/src-ui/logics/configs/transcription/useTranscription.js b/src-ui/logics/configs/transcription/useTranscription.js index 294b0473..4af6a28c 100644 --- a/src-ui/logics/configs/transcription/useTranscription.js +++ b/src-ui/logics/configs/transcription/useTranscription.js @@ -8,12 +8,14 @@ import { useStore_SpeakerPhraseTimeout, useStore_SpeakerRecordTimeout, - useStore_SelectableWhisperComputeDeviceList, + useStore_SelectableTranscriptionComputeDeviceList, useStore_SelectedTranscriptionEngine, - useStore_SelectedWhisperComputeDevice, - useStore_SelectedWhisperWeightType, + useStore_SelectedTranscriptionComputeDevice, useStore_WhisperWeightTypeStatus, + useStore_SelectedWhisperWeightType, + useStore_SelectedWhisperComputeType, + useStore_SelectableWhisperComputeTypeList, useStore_MicAvgLogprob, useStore_MicNoSpeechProb, @@ -21,7 +23,7 @@ import { useStore_SpeakerNoSpeechProb, } from "@store"; import { useStdoutToPython } from "@useStdoutToPython"; -import { transformToIndexedArray } from "@utils"; +import { transformToIndexedArray, arrayToObject } from "@utils"; import { useNotificationStatus } from "@logics_common"; export const useTranscription = () => { @@ -41,10 +43,16 @@ export const useTranscription = () => { // Transcription Engines const { currentSelectedTranscriptionEngine, updateSelectedTranscriptionEngine, pendingSelectedTranscriptionEngine } = useStore_SelectedTranscriptionEngine(); + const { currentWhisperWeightTypeStatus, updateWhisperWeightTypeStatus, pendingWhisperWeightTypeStatus } = useStore_WhisperWeightTypeStatus(); const { currentSelectedWhisperWeightType, updateSelectedWhisperWeightType, pendingSelectedWhisperWeightType } = useStore_SelectedWhisperWeightType(); - const { currentSelectableWhisperComputeDeviceList, updateSelectableWhisperComputeDeviceList, pendingSelectableWhisperComputeDeviceList } = useStore_SelectableWhisperComputeDeviceList(); - const { currentSelectedWhisperComputeDevice, updateSelectedWhisperComputeDevice, pendingSelectedWhisperComputeDevice } = useStore_SelectedWhisperComputeDevice(); + + + const { currentSelectableWhisperComputeTypeList, updateSelectableWhisperComputeTypeList, pendingSelectableWhisperComputeTypeList } = useStore_SelectableWhisperComputeTypeList(); + const { currentSelectedWhisperComputeType, updateSelectedWhisperComputeType, pendingSelectedWhisperComputeType } = useStore_SelectedWhisperComputeType(); + + const { currentSelectableTranscriptionComputeDeviceList, updateSelectableTranscriptionComputeDeviceList, pendingSelectableTranscriptionComputeDeviceList } = useStore_SelectableTranscriptionComputeDeviceList(); + const { currentSelectedTranscriptionComputeDevice, updateSelectedTranscriptionComputeDevice, pendingSelectedTranscriptionComputeDevice } = useStore_SelectedTranscriptionComputeDevice(); // Advanced Settings const { currentMicAvgLogprob, updateMicAvgLogprob, pendingMicAvgLogprob } = useStore_MicAvgLogprob(); @@ -246,6 +254,33 @@ export const useTranscription = () => { asyncStdoutToPython("/run/download_whisper_weight", weight_type); }; + + const getSelectableWhisperComputeTypeList = () => { + pendingSelectableWhisperComputeTypeList(); + asyncStdoutToPython("/get/data/whisper_compute_type_list"); + }; + + const updateSelectableWhisperComputeTypeList_FromBackend = (payload) => { + updateSelectableWhisperComputeTypeList(arrayToObject(payload)); + }; + + + const getSelectedWhisperComputeType = () => { + pendingSelectedWhisperComputeType(); + asyncStdoutToPython("/get/data/whisper_compute_type"); + }; + + const setSelectedWhisperComputeType = (selected_whisper_compute_type) => { + pendingSelectedWhisperComputeType(); + asyncStdoutToPython("/set/data/whisper_compute_type", selected_whisper_compute_type); + }; + + const setSuccessSelectedWhisperComputeType = (selected_whisper_compute_type) => { + updateSelectedWhisperComputeType(selected_whisper_compute_type); + showNotification_SaveSuccess(); + }; + + // Transcription Engines (Selected Weight Type) const getSelectedWhisperWeightType = () => { pendingSelectedWhisperWeightType(); @@ -263,28 +298,28 @@ export const useTranscription = () => { }; // Transcription Engines (Compute Device List) - const getSelectableWhisperComputeDeviceList = () => { - pendingSelectableWhisperComputeDeviceList(); + const getSelectableTranscriptionComputeDeviceList = () => { + pendingSelectableTranscriptionComputeDeviceList(); asyncStdoutToPython("/get/data/transcription_compute_device_list"); }; - const updateSelectableWhisperComputeDeviceList_FromBackend = (payload) => { - updateSelectableWhisperComputeDeviceList(transformToIndexedArray(payload)); + const updateSelectableTranscriptionComputeDeviceList_FromBackend = (payload) => { + updateSelectableTranscriptionComputeDeviceList(transformToIndexedArray(payload)); }; // Transcription Engines (Selected Compute Device) - const getSelectedWhisperComputeDevice = () => { - pendingSelectedWhisperComputeDevice(); + const getSelectedTranscriptionComputeDevice = () => { + pendingSelectedTranscriptionComputeDevice(); asyncStdoutToPython("/get/data/selected_transcription_compute_device"); }; - const setSelectedWhisperComputeDevice = (selected_transcription_compute_device) => { - pendingSelectedWhisperComputeDevice(); + const setSelectedTranscriptionComputeDevice = (selected_transcription_compute_device) => { + pendingSelectedTranscriptionComputeDevice(); asyncStdoutToPython("/set/data/selected_transcription_compute_device", selected_transcription_compute_device); }; - const setSuccessSelectedWhisperComputeDevice = (dev) => { - updateSelectedWhisperComputeDevice(dev); + const setSuccessSelectedTranscriptionComputeDevice = (dev) => { + updateSelectedTranscriptionComputeDevice(dev); showNotification_SaveSuccess(); }; @@ -416,16 +451,29 @@ export const useTranscription = () => { setSelectedWhisperWeightType, setSuccessSelectedWhisperWeightType, - currentSelectableWhisperComputeDeviceList, - getSelectableWhisperComputeDeviceList, - updateSelectableWhisperComputeDeviceList, - updateSelectableWhisperComputeDeviceList_FromBackend, - currentSelectedWhisperComputeDevice, - getSelectedWhisperComputeDevice, - updateSelectedWhisperComputeDevice, - setSelectedWhisperComputeDevice, - setSuccessSelectedWhisperComputeDevice, + currentSelectableWhisperComputeTypeList, + getSelectableWhisperComputeTypeList, + updateSelectableWhisperComputeTypeList, + updateSelectableWhisperComputeTypeList_FromBackend, + + currentSelectedWhisperComputeType, + getSelectedWhisperComputeType, + updateSelectedWhisperComputeType, + setSelectedWhisperComputeType, + setSuccessSelectedWhisperComputeType, + + + currentSelectableTranscriptionComputeDeviceList, + getSelectableTranscriptionComputeDeviceList, + updateSelectableTranscriptionComputeDeviceList, + updateSelectableTranscriptionComputeDeviceList_FromBackend, + + currentSelectedTranscriptionComputeDevice, + getSelectedTranscriptionComputeDevice, + updateSelectedTranscriptionComputeDevice, + setSelectedTranscriptionComputeDevice, + setSuccessSelectedTranscriptionComputeDevice, // Advanced // Mic Avg Logprob diff --git a/src-ui/logics/useReceiveRoutes.js b/src-ui/logics/useReceiveRoutes.js index d3452721..a4b92e6e 100644 --- a/src-ui/logics/useReceiveRoutes.js +++ b/src-ui/logics/useReceiveRoutes.js @@ -214,18 +214,22 @@ export const ROUTE_META_LIST = [ { endpoint: "/get/data/selected_transcription_engine", ns: configs, hook_name: "useTranscription", method_name: "updateSelectedTranscriptionEngine" }, { endpoint: "/set/data/selected_transcription_engine", ns: configs, hook_name: "useTranscription", method_name: "setSuccessSelectedTranscriptionEngine" }, + { endpoint: "/get/data/selectable_whisper_weight_type_dict", ns: configs, hook_name: "useTranscription", method_name: "updateDownloadedWhisperWeightTypeStatus" }, { endpoint: "/get/data/whisper_weight_type", ns: configs, hook_name: "useTranscription", method_name: "updateSelectedWhisperWeightType" }, { endpoint: "/set/data/whisper_weight_type", ns: configs, hook_name: "useTranscription", method_name: "setSuccessSelectedWhisperWeightType" }, - { endpoint: "/get/data/selectable_whisper_weight_type_dict", ns: configs, hook_name: "useTranscription", method_name: "updateDownloadedWhisperWeightTypeStatus" }, + { endpoint: "/get/data/whisper_compute_type_list", ns: configs, hook_name: "useTranscription", method_name: "updateSelectableWhisperComputeTypeList_FromBackend" }, + { endpoint: "/get/data/whisper_compute_type", ns: configs, hook_name: "useTranscription", method_name: "updateSelectedWhisperComputeType" }, + { endpoint: "/set/data/whisper_compute_type", ns: configs, hook_name: "useTranscription", method_name: "setSuccessSelectedWhisperComputeType" }, + { endpoint: "/run/downloaded_whisper_weight", ns: configs, hook_name: "useTranscription", method_name: "downloadedWhisperWeightType" }, { endpoint: "/run/download_whisper_weight", ns: null, hook_name: null, method_name: null }, { endpoint: "/run/download_progress_whisper_weight", ns: configs, hook_name: "useTranscription", method_name: "updateDownloadProgressWhisperWeightTypeStatus" }, - { endpoint: "/get/data/transcription_compute_device_list", ns: configs, hook_name: "useTranscription", method_name: "updateSelectableWhisperComputeDeviceList_FromBackend" }, - { endpoint: "/get/data/selected_transcription_compute_device", ns: configs, hook_name: "useTranscription", method_name: "updateSelectedWhisperComputeDevice" }, - { endpoint: "/set/data/selected_transcription_compute_device", ns: configs, hook_name: "useTranscription", method_name: "setSuccessSelectedWhisperComputeDevice" }, + { endpoint: "/get/data/transcription_compute_device_list", ns: configs, hook_name: "useTranscription", method_name: "updateSelectableTranscriptionComputeDeviceList_FromBackend" }, + { endpoint: "/get/data/selected_transcription_compute_device", ns: configs, hook_name: "useTranscription", method_name: "updateSelectedTranscriptionComputeDevice" }, + { endpoint: "/set/data/selected_transcription_compute_device", ns: configs, hook_name: "useTranscription", method_name: "setSuccessSelectedTranscriptionComputeDevice" }, // Transcription (Advanced) { endpoint: "/get/data/mic_avg_logprob", ns: configs, hook_name: "useTranscription", method_name: "updateMicAvgLogprob" }, diff --git a/src-ui/store.js b/src-ui/store.js index ba00127b..6d110bce 100644 --- a/src-ui/store.js +++ b/src-ui/store.js @@ -240,8 +240,12 @@ export const { atomInstance: Atom_SelectedWhisperWeightType, useHook: useStore_S export const { atomInstance: Atom_WhisperWeightTypeStatus, useHook: useStore_WhisperWeightTypeStatus } = createAtomWithHook(whisper_weight_type_status, "WhisperWeightTypeStatus"); export const { atomInstance: Atom_SelectedTranscriptionEngine, useHook: useStore_SelectedTranscriptionEngine } = createAtomWithHook(whisper_weight_type_status, "SelectedTranscriptionEngine"); -export const { atomInstance: Atom_SelectableWhisperComputeDeviceList, useHook: useStore_SelectableWhisperComputeDeviceList } = createAtomWithHook({}, "SelectableWhisperComputeDeviceList"); -export const { atomInstance: Atom_SelectedWhisperComputeDevice, useHook: useStore_SelectedWhisperComputeDevice } = createAtomWithHook("", "SelectedWhisperComputeDevice"); +export const { atomInstance: Atom_SelectableWhisperComputeTypeList, useHook: useStore_SelectableWhisperComputeTypeList } = createAtomWithHook({}, "SelectableWhisperComputeTypeList"); +export const { atomInstance: Atom_SelectedWhisperComputeType, useHook: useStore_SelectedWhisperComputeType } = createAtomWithHook("", "SelectedWhisperComputeType"); + + +export const { atomInstance: Atom_SelectableTranscriptionComputeDeviceList, useHook: useStore_SelectableTranscriptionComputeDeviceList } = createAtomWithHook({}, "SelectableTranscriptionComputeDeviceList"); +export const { atomInstance: Atom_SelectedTranscriptionComputeDevice, useHook: useStore_SelectedTranscriptionComputeDevice } = createAtomWithHook("", "SelectedTranscriptionComputeDevice"); export const { atomInstance: Atom_MicAvgLogprob, useHook: useStore_MicAvgLogprob } = createAtomWithHook(-0.8, "MicAvgLogprob"); export const { atomInstance: Atom_MicNoSpeechProb, useHook: useStore_MicNoSpeechProb } = createAtomWithHook(0.6, "MicNoSpeechProb");