From 1a84eaf66498f711ed1b4cf1d45a5a66181e80aa Mon Sep 17 00:00:00 2001 From: "manickavela1998@gmail.com" Date: Thu, 4 Jul 2024 12:34:04 +0000 Subject: [PATCH] clean up Signed-off-by: manickavela1998@gmail.com --- sherpa-onnx/csrc/provider-config.cc | 8 +++++--- sherpa-onnx/python/csrc/sherpa-onnx.h | 2 -- sherpa-onnx/python/sherpa_onnx/__init__.py | 1 - 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/sherpa-onnx/csrc/provider-config.cc b/sherpa-onnx/csrc/provider-config.cc index 2d4109040..422130239 100644 --- a/sherpa-onnx/csrc/provider-config.cc +++ b/sherpa-onnx/csrc/provider-config.cc @@ -113,9 +113,11 @@ void ProviderConfig::Register(ParseOptions *po) { } bool ProviderConfig::Validate() const { - if (device < 0) { - SHERPA_ONNX_LOGE("device: '%d' is invalid.", device); - return false; + if(provider == "cuda" || provider == "trt") { + if (device < 0) { + SHERPA_ONNX_LOGE("device: '%d' is invalid.", device); + return false; + } } return true; } diff --git a/sherpa-onnx/python/csrc/sherpa-onnx.h b/sherpa-onnx/python/csrc/sherpa-onnx.h index 54fd4e88f..7bce9f49b 100644 --- a/sherpa-onnx/python/csrc/sherpa-onnx.h +++ b/sherpa-onnx/python/csrc/sherpa-onnx.h @@ -5,8 +5,6 @@ #ifndef SHERPA_ONNX_PYTHON_CSRC_SHERPA_ONNX_H_ #define SHERPA_ONNX_PYTHON_CSRC_SHERPA_ONNX_H_ -#define PYBIND11_DETAILED_ERROR_MESSAGES - #include "pybind11/functional.h" #include "pybind11/numpy.h" #include "pybind11/pybind11.h" diff --git a/sherpa-onnx/python/sherpa_onnx/__init__.py b/sherpa-onnx/python/sherpa_onnx/__init__.py index faccfe3f5..7a832ba06 100644 --- a/sherpa-onnx/python/sherpa_onnx/__init__.py +++ b/sherpa-onnx/python/sherpa_onnx/__init__.py @@ -16,7 +16,6 @@ OfflineTtsVitsModelConfig, OfflineZipformerAudioTaggingModelConfig, OnlineStream, - ProviderConfig, SileroVadModelConfig, SpeakerEmbeddingExtractor, SpeakerEmbeddingExtractorConfig,