File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -67,8 +67,11 @@ def parse_known_args(argv):
6767
6868class PostProcessor (beam .DoFn ):
6969 def process (self , element : PredictionResult ) -> Iterable [str ]:
70- yield "Input: " + str (element .example ) + " Output: " + str (
71- element .inference [1 ][0 ].content .parts [0 ].text )
70+ try :
71+ output_text = element .inference [1 ][0 ].content .parts [0 ].text
72+ yield f"Input: { element .example } , Output: { output_text } "
73+ except Exception :
74+ yield f"Can't decode inference for element: { element .example } "
7275
7376
7477def run (
Original file line number Diff line number Diff line change @@ -155,7 +155,7 @@ def __init__(
155155 username = username ,
156156 password = password ,
157157 host = host ,
158- port = port ,
158+ port = str ( port ) ,
159159 max_number_of_records = max_number_of_records ,
160160 connection_properties = connection_properties )
161161 self .expansion_service = expansion_service or default_io_expansion_service ()
You can’t perform that action at this time.
0 commit comments