[Update/Chore] Config Page: Put the selectors 'Compute Device' and 'Compute Type' to the same section.

Rename: UI: CTranslate2/Whisper Compute Type to Translation/Transcription Compute Type.
This commit is contained in:
Sakamoto Shiina
2025-09-26 17:07:19 +09:00
parent 92f9d645f8
commit 8c5f1b5db2
14 changed files with 402 additions and 208 deletions

View File

@@ -14,8 +14,7 @@ import {
useStore_WhisperWeightTypeStatus,
useStore_SelectedWhisperWeightType,
useStore_SelectedWhisperComputeType,
useStore_SelectableWhisperComputeTypeList,
useStore_SelectedTranscriptionComputeType,
useStore_MicAvgLogprob,
useStore_MicNoSpeechProb,
@@ -48,8 +47,7 @@ export const useTranscription = () => {
const { currentSelectedWhisperWeightType, updateSelectedWhisperWeightType, pendingSelectedWhisperWeightType } = useStore_SelectedWhisperWeightType();
const { currentSelectableWhisperComputeTypeList, updateSelectableWhisperComputeTypeList, pendingSelectableWhisperComputeTypeList } = useStore_SelectableWhisperComputeTypeList();
const { currentSelectedWhisperComputeType, updateSelectedWhisperComputeType, pendingSelectedWhisperComputeType } = useStore_SelectedWhisperComputeType();
const { currentSelectedTranscriptionComputeType, updateSelectedTranscriptionComputeType, pendingSelectedTranscriptionComputeType } = useStore_SelectedTranscriptionComputeType();
const { currentSelectableTranscriptionComputeDeviceList, updateSelectableTranscriptionComputeDeviceList, pendingSelectableTranscriptionComputeDeviceList } = useStore_SelectableTranscriptionComputeDeviceList();
const { currentSelectedTranscriptionComputeDevice, updateSelectedTranscriptionComputeDevice, pendingSelectedTranscriptionComputeDevice } = useStore_SelectedTranscriptionComputeDevice();
@@ -255,28 +253,19 @@ export const useTranscription = () => {
};
const getSelectableWhisperComputeTypeList = () => {
pendingSelectableWhisperComputeTypeList();
asyncStdoutToPython("/get/data/whisper_compute_type_list");
const getSelectedTranscriptionComputeType = () => {
pendingSelectedTranscriptionComputeType();
asyncStdoutToPython("/get/data/transcription_compute_type");
};
const updateSelectableWhisperComputeTypeList_FromBackend = (payload) => {
updateSelectableWhisperComputeTypeList(arrayToObject(payload));
const setSelectedTranscriptionComputeType = (selected_transcription_compute_type) => {
pendingSelectedTranscriptionComputeType();
asyncStdoutToPython("/set/data/transcription_compute_type", selected_transcription_compute_type);
};
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);
const setSuccessSelectedTranscriptionComputeType = (selected_transcription_compute_type) => {
updateSelectedTranscriptionComputeType(selected_transcription_compute_type);
showNotification_SaveSuccess();
};
@@ -452,16 +441,11 @@ export const useTranscription = () => {
setSuccessSelectedWhisperWeightType,
currentSelectableWhisperComputeTypeList,
getSelectableWhisperComputeTypeList,
updateSelectableWhisperComputeTypeList,
updateSelectableWhisperComputeTypeList_FromBackend,
currentSelectedWhisperComputeType,
getSelectedWhisperComputeType,
updateSelectedWhisperComputeType,
setSelectedWhisperComputeType,
setSuccessSelectedWhisperComputeType,
currentSelectedTranscriptionComputeType,
getSelectedTranscriptionComputeType,
updateSelectedTranscriptionComputeType,
setSelectedTranscriptionComputeType,
setSuccessSelectedTranscriptionComputeType,
currentSelectableTranscriptionComputeDeviceList,

View File

@@ -1,8 +1,7 @@
import {
useStore_CTranslate2WeightTypeStatus,
useStore_SelectedCTranslate2WeightType,
useStore_SelectableCTranslate2ComputeTypeList,
useStore_SelectedCTranslate2ComputeType,
useStore_SelectedTranslationComputeType,
useStore_SelectableTranslationComputeDeviceList,
useStore_SelectedTranslationComputeDevice,
useStore_DeepLAuthKey,
@@ -20,8 +19,7 @@ export const useTranslation = () => {
const { currentCTranslate2WeightTypeStatus, updateCTranslate2WeightTypeStatus, pendingCTranslate2WeightTypeStatus } = useStore_CTranslate2WeightTypeStatus();
const { currentSelectedCTranslate2WeightType, updateSelectedCTranslate2WeightType, pendingSelectedCTranslate2WeightType } = useStore_SelectedCTranslate2WeightType();
const { currentSelectableCTranslate2ComputeTypeList, updateSelectableCTranslate2ComputeTypeList, pendingSelectableCTranslate2ComputeTypeList } = useStore_SelectableCTranslate2ComputeTypeList();
const { currentSelectedCTranslate2ComputeType, updateSelectedCTranslate2ComputeType, pendingSelectedCTranslate2ComputeType } = useStore_SelectedCTranslate2ComputeType();
const { currentSelectedTranslationComputeType, updateSelectedTranslationComputeType, pendingSelectedTranslationComputeType } = useStore_SelectedTranslationComputeType();
const { currentSelectableTranslationComputeDeviceList, updateSelectableTranslationComputeDeviceList, pendingSelectableTranslationComputeDeviceList } = useStore_SelectableTranslationComputeDeviceList();
const { currentSelectedTranslationComputeDevice, updateSelectedTranslationComputeDevice, pendingSelectedTranslationComputeDevice } = useStore_SelectedTranslationComputeDevice();
@@ -87,29 +85,18 @@ export const useTranslation = () => {
};
const getSelectableCTranslate2ComputeTypeList = () => {
pendingSelectableCTranslate2ComputeTypeList();
asyncStdoutToPython("/get/data/ctranslate2_compute_type_list");
const getSelectedTranslationComputeType = () => {
pendingSelectedTranslationComputeType();
asyncStdoutToPython("/get/data/translation_compute_type");
};
const updateSelectableCTranslate2ComputeTypeList_FromBackend = (payload) => {
updateSelectableCTranslate2ComputeTypeList(arrayToObject(payload));
const setSelectedTranslationComputeType = (selected_translation_compute_type) => {
pendingSelectedTranslationComputeType();
asyncStdoutToPython("/set/data/translation_compute_type", selected_translation_compute_type);
};
const getSelectedCTranslate2ComputeType = () => {
pendingSelectedCTranslate2ComputeType();
asyncStdoutToPython("/get/data/ctranslate2_compute_type");
};
const setSelectedCTranslate2ComputeType = (selected_ctranslate2_compute_type) => {
pendingSelectedCTranslate2ComputeType();
asyncStdoutToPython("/set/data/ctranslate2_compute_type", selected_ctranslate2_compute_type);
};
const setSuccessSelectedCTranslate2ComputeType = (selected_ctranslate2_compute_type) => {
updateSelectedCTranslate2ComputeType(selected_ctranslate2_compute_type);
const setSuccessSelectedTranslationComputeType = (selected_translation_compute_type) => {
updateSelectedTranslationComputeType(selected_translation_compute_type);
showNotification_SaveSuccess();
};
@@ -182,16 +169,11 @@ export const useTranslation = () => {
setSuccessSelectedCTranslate2WeightType,
currentSelectableCTranslate2ComputeTypeList,
getSelectableCTranslate2ComputeTypeList,
updateSelectableCTranslate2ComputeTypeList,
updateSelectableCTranslate2ComputeTypeList_FromBackend,
currentSelectedCTranslate2ComputeType,
getSelectedCTranslate2ComputeType,
updateSelectedCTranslate2ComputeType,
setSelectedCTranslate2ComputeType,
setSuccessSelectedCTranslate2ComputeType,
currentSelectedTranslationComputeType,
getSelectedTranslationComputeType,
updateSelectedTranslationComputeType,
setSelectedTranslationComputeType,
setSuccessSelectedTranslationComputeType,
currentSelectableTranslationComputeDeviceList,

View File

@@ -172,9 +172,8 @@ export const ROUTE_META_LIST = [
{ endpoint: "/get/data/ctranslate2_weight_type", ns: configs, hook_name: "useTranslation", method_name: "updateSelectedCTranslate2WeightType" },
{ endpoint: "/set/data/ctranslate2_weight_type", ns: configs, hook_name: "useTranslation", method_name: "setSuccessSelectedCTranslate2WeightType" },
{ endpoint: "/get/data/ctranslate2_compute_type_list", ns: configs, hook_name: "useTranslation", method_name: "updateSelectableCTranslate2ComputeTypeList_FromBackend" },
{ endpoint: "/get/data/ctranslate2_compute_type", ns: configs, hook_name: "useTranslation", method_name: "updateSelectedCTranslate2ComputeType" },
{ endpoint: "/set/data/ctranslate2_compute_type", ns: configs, hook_name: "useTranslation", method_name: "setSuccessSelectedCTranslate2ComputeType" },
{ endpoint: "/get/data/translation_compute_type", ns: configs, hook_name: "useTranslation", method_name: "updateSelectedTranslationComputeType" },
{ endpoint: "/set/data/translation_compute_type", ns: configs, hook_name: "useTranslation", method_name: "setSuccessSelectedTranslationComputeType" },
{ endpoint: "/run/downloaded_ctranslate2_weight", ns: configs, hook_name: "useTranslation", method_name: "downloadedCTranslate2WeightType" },
{ endpoint: "/run/download_ctranslate2_weight", ns: null, hook_name: null, method_name: null },
@@ -218,9 +217,8 @@ export const ROUTE_META_LIST = [
{ 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/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: "/get/data/transcription_compute_type", ns: configs, hook_name: "useTranscription", method_name: "updateSelectedTranscriptionComputeType" },
{ endpoint: "/set/data/transcription_compute_type", ns: configs, hook_name: "useTranscription", method_name: "setSuccessSelectedTranscriptionComputeType" },
{ endpoint: "/run/downloaded_whisper_weight", ns: configs, hook_name: "useTranscription", method_name: "downloadedWhisperWeightType" },