[Update/Chore] Config Page: Add 'Whisper Compute Type' Selection.

UI: Rename 'Whisper compute device' to 'Transcription compute device'.
This commit is contained in:
Sakamoto Shiina
2025-09-19 15:58:19 +09:00
parent 4808dcbc96
commit 9fd61677f9
9 changed files with 144 additions and 53 deletions

View File

@@ -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

View File

@@ -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" },