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,