@@ -31,6 +31,9 @@ def parse_args() -> argparse.Namespace:
31
31
help = "If this option is set, then `--query` argument is ignored and the script suggests user to enter "
32
32
"queries to standard input." ,
33
33
)
34
+ parser .add_argument (
35
+ "--language-code" , default = "en-US" , help = "Language code of the model to be used." ,
36
+ )
34
37
parser = add_connection_argparse_parameters (parser )
35
38
return parser .parse_args ()
36
39
@@ -43,15 +46,19 @@ def run_punct_capit(args: argparse.Namespace) -> None:
43
46
query = input ("Enter a query: " )
44
47
start = time .time ()
45
48
result = riva .client .nlp .extract_most_probable_transformed_text (
46
- nlp_service .punctuate_text (input_strings = query , model_name = args .model )
49
+ nlp_service .punctuate_text (
50
+ input_strings = query , model_name = args .model , language_code = args .language_code
51
+ )
47
52
)
48
53
end = time .time ()
49
54
print (f"Inference complete in { (end - start ) * 1000 :.4f} ms" )
50
55
print (result , end = '\n ' * 2 )
51
56
else :
52
57
print (
53
58
riva .client .nlp .extract_most_probable_transformed_text (
54
- nlp_service .punctuate_text (input_strings = args .query , model_name = args .model )
59
+ nlp_service .punctuate_text (
60
+ input_strings = args .query , model_name = args .model , language_code = args .language_code
61
+ )
55
62
)
56
63
)
57
64
0 commit comments