@@ -63,6 +63,7 @@ DEFINE_string(
63
63
output_filename, " final_transcripts.json" ,
64
64
" Filename of .json file containing output transcripts" );
65
65
DEFINE_string (model_name, " " , " Name of the TRTIS model to use" );
66
+ DEFINE_bool (list_models, false , " List available models on server" );
66
67
DEFINE_string (language_code, " en-US" , " Language code of the model to use" );
67
68
DEFINE_string (boosted_words_file, " " , " File with a list of words to boost. One line per word." );
68
69
DEFINE_double (boosted_words_score, 10 ., " Score by which to boost the boosted words" );
@@ -133,6 +134,8 @@ main(int argc, char** argv)
133
134
str_usage << " --boosted_words_file=<string>" << std::endl;
134
135
str_usage << " --boosted_words_score=<float>" << std::endl;
135
136
str_usage << " --ssl_cert=<filename>" << std::endl;
137
+ str_usage << " --model_name=<model>" << std::endl;
138
+ str_usage << " --list_models" << std::endl;
136
139
str_usage << " --metadata=<key,value,...>" << std::endl;
137
140
str_usage << " --start_history=<int>" << std::endl;
138
141
str_usage << " --start_threshold=<float>" << std::endl;
@@ -182,6 +185,29 @@ main(int argc, char** argv)
182
185
return 1 ;
183
186
}
184
187
188
+ if (FLAGS_list_models) {
189
+ std::unique_ptr<nr_asr::RivaSpeechRecognition::Stub> asr_stub_ (
190
+ nr_asr::RivaSpeechRecognition::NewStub (grpc_channel));
191
+ grpc::ClientContext asr_context;
192
+ nr_asr::RivaSpeechRecognitionConfigRequest asr_request;
193
+ nr_asr::RivaSpeechRecognitionConfigResponse asr_response;
194
+ asr_stub_->GetRivaSpeechRecognitionConfig (&asr_context, asr_request, &asr_response);
195
+
196
+ std::multimap<std::string, std::string> model_map;
197
+ for (int i = 0 ; i < asr_response.model_config_size (); i++) {
198
+ if (asr_response.model_config (i).parameters ().find (" type" )->second == " online" ) {
199
+ model_map.insert (std::make_pair (
200
+ asr_response.model_config (i).parameters ().find (" language_code" )->second ,
201
+ asr_response.model_config (i).model_name ()));
202
+ }
203
+ }
204
+
205
+ for (auto & m : model_map) {
206
+ std::cout << " '" << m.first << " ': '" << m.second << " '" << std::endl;
207
+ }
208
+ return 0 ;
209
+ }
210
+
185
211
StreamingRecognizeClient recognize_client (
186
212
grpc_channel, FLAGS_num_parallel_requests, FLAGS_language_code, FLAGS_max_alternatives,
187
213
FLAGS_profanity_filter, FLAGS_word_time_offsets, FLAGS_automatic_punctuation,
@@ -230,4 +256,4 @@ main(int argc, char** argv)
230
256
}
231
257
232
258
return 0 ;
233
- }
259
+ }
0 commit comments