File tree Expand file tree Collapse file tree
nemo/collections/tts/modules/magpietts_inference
tests/collections/tts/modules/magpietts_inference Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -256,7 +256,7 @@ def load_evaluation_models(
256256 elif asr_model_type == "whisper" :
257257 models ['asr_model' ] = WhisperTranscriber (model_name = asr_model_name , device = device )
258258 else :
259- raise ValueError (f"Unknown ASR model type { asr_model_name } " )
259+ raise ValueError (f"Unknown ASR model type { asr_model_type } " )
260260
261261 if sv_model_type == "wavlm" :
262262 models ['feature_extractor' ] = Wav2Vec2FeatureExtractor .from_pretrained ('microsoft/wavlm-base-plus-sv' )
Original file line number Diff line number Diff line change 1+ # Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+
15+ """
16+ Tests for MagpieTTS generated audio evaluation utilities.
17+ """
18+
19+ import pytest
20+
21+ from nemo .collections .tts .modules .magpietts_inference .evaluate_generated_audio import load_evaluation_models
22+
23+
24+ class TestLoadEvaluationModels :
25+ """Tests for load_evaluation_models."""
26+
27+ def test_unknown_asr_model_type_error_includes_type (self ):
28+ """Unknown asr_model_type should be reported in the error message, not the model name."""
29+ with pytest .raises (ValueError , match = "Unknown ASR model type invalid_type" ):
30+ load_evaluation_models (asr_model_type = "invalid_type" , asr_model_name = "some_model_name" )
You can’t perform that action at this time.
0 commit comments