File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,17 +54,20 @@ interface NodePrediction {
5454 // Wait for Python inference to start.
5555 log . verbose ( 'waiting for Python' ) ;
5656 await new Promise < void > ( ( resolve , reject ) => {
57+ let loaded = false ;
5758 const messageListener = ( data : string ) => {
5859 console . log ( `PYTHON: ${ data } ` ) ;
5960 log . silly ( 'python stdout' , { data } ) ;
6061 if ( data === 'Inference started.' ) {
62+ loaded = true ;
6163 python . off ( 'message' , messageListener ) ;
6264 resolve ( ) ;
6365 }
6466 } ;
6567 python . on ( 'message' , messageListener ) ;
6668 python . on ( 'stderr' , ( data ) => {
67- if ( log . isLevelEnabled ( 'debug' ) ) console . error ( `PYTERR: ${ data } ` ) ;
69+ if ( ! loaded || log . isLevelEnabled ( 'debug' ) )
70+ console . error ( `PYTERR: ${ data } ` ) ;
6871 log . silly ( 'python stderr' , { data } ) ;
6972 } ) ;
7073 python . on ( 'close' , ( ) => {
You can’t perform that action at this time.
0 commit comments