diff --git a/src-python/controller.py b/src-python/controller.py index afa9d266..77717918 100644 --- a/src-python/controller.py +++ b/src-python/controller.py @@ -1456,11 +1456,15 @@ class Controller: return {"status":200, "result":config.CTRANSLATE2_WEIGHT_TYPE} @staticmethod - def getCtranslateComputeType(*args, **kwargs) -> dict: + def getCtranslate2ComputeTypeList(*args, **kwargs) -> dict: + return {"status":200, "result":config.SELECTABLE_CTRANSLATE2_COMPUTE_TYPE_LIST} + + @staticmethod + def getCtranslate2ComputeType(*args, **kwargs) -> dict: return {"status":200, "result":config.CTRANSLATE2_COMPUTE_TYPE} @staticmethod - def setCtranslateComputeType(data, *args, **kwargs) -> dict: + def setCtranslate2ComputeType(data, *args, **kwargs) -> dict: config.CTRANSLATE2_COMPUTE_TYPE = str(data) if model.checkTranslatorCTranslate2ModelWeight(config.CTRANSLATE2_WEIGHT_TYPE): def callback(): diff --git a/src-python/mainloop.py b/src-python/mainloop.py index 2ad6e078..c7b03ea6 100644 --- a/src-python/mainloop.py +++ b/src-python/mainloop.py @@ -162,8 +162,10 @@ mapping = { "/get/data/ctranslate2_weight_type": {"status": True, "variable":controller.getCtranslate2WeightType}, "/set/data/ctranslate2_weight_type": {"status": True, "variable":controller.setCtranslate2WeightType}, - "/get/data/ctranslate2_compute_type": {"status": True, "variable":controller.getCtranslateComputeType}, - "/set/data/ctranslate2_compute_type": {"status": True, "variable":controller.setCtranslateComputeType}, + "/get/data/ctranslate2_compute_type_list": {"status": True, "variable":controller.getCtranslate2ComputeTypeList}, + + "/get/data/ctranslate2_compute_type": {"status": True, "variable":controller.getCtranslate2ComputeType}, + "/set/data/ctranslate2_compute_type": {"status": True, "variable":controller.setCtranslate2ComputeType}, "/run/download_ctranslate2_weight": {"status": True, "variable":controller.downloadCtranslate2Weight}, @@ -268,6 +270,8 @@ mapping = { "/get/data/whisper_weight_type": {"status": True, "variable":controller.getWhisperWeightType}, "/set/data/whisper_weight_type": {"status": True, "variable":controller.setWhisperWeightType}, + "/get/data/whisper_compute_type_list": {"status": True, "variable":controller.getWhisperComputeTypeList}, + "/get/data/whisper_compute_type": {"status": True, "variable":controller.getWhisperComputeType}, "/set/data/whisper_compute_type": {"status": True, "variable":controller.setWhisperComputeType},