[Update] Config Page: Translation, Transcription Tab. Add Select CTranslate2/Whisper Compute Device section.

This commit is contained in:
Sakamoto Shiina committed 2024-12-03 10:25:53 +09:00
1 parent e6a7ff03aa
commit 7d8a2cacd0
14 files changed
+297 -9

No files matched your search

@@ -0,0 +1,18 @@
import { useStore_SelectableWhisperComputeDeviceList } from "@store";
import { useStdoutToPython } from "@logics/useStdoutToPython";
export const useSelectableWhisperComputeDeviceList = () => {
const { asyncStdoutToPython } = useStdoutToPython();
const { currentSelectableWhisperComputeDeviceList, updateSelectableWhisperComputeDeviceList, pendingSelectableWhisperComputeDeviceList } = useStore_SelectableWhisperComputeDeviceList();
const getSelectableWhisperComputeDeviceList = () => {
pendingSelectableWhisperComputeDeviceList();
asyncStdoutToPython("/get/data/transcription_compute_device_list");
};
return {
currentSelectableWhisperComputeDeviceList,
getSelectableWhisperComputeDeviceList,
updateSelectableWhisperComputeDeviceList,
};
};
@@ -0,0 +1,24 @@
import { useStore_SelectedWhisperComputeDevice } from "@store";
import { useStdoutToPython } from "@logics/useStdoutToPython";
export const useSelectedWhisperComputeDevice = () => {
const { asyncStdoutToPython } = useStdoutToPython();
const { currentSelectedWhisperComputeDevice, updateSelectedWhisperComputeDevice, pendingSelectedWhisperComputeDevice } = useStore_SelectedWhisperComputeDevice();
const getSelectedWhisperComputeDevice = () => {
pendingSelectedWhisperComputeDevice();
asyncStdoutToPython("/get/data/selected_transcription_compute_device");
};
const setSelectedWhisperComputeDevice = (selected_transcription_compute_device) => {
pendingSelectedWhisperComputeDevice();
asyncStdoutToPython("/set/data/selected_transcription_compute_device", selected_transcription_compute_device);
};
return {
currentSelectedWhisperComputeDevice,
getSelectedWhisperComputeDevice,
updateSelectedWhisperComputeDevice,
setSelectedWhisperComputeDevice,
};
};