@@ -172,12 +172,11 @@ public Task<Tensor<float>> GenerateAsync(PipelineOptions options, CancellationTo
172172 using ( var scheduler = PyObject . From ( options . Scheduler . ToString ( ) ) )
173173 using ( var numFrames = PyObject . From ( options . Frames ) )
174174 using ( var shift = PyObject . From ( options . Shift ) )
175- using ( var flowShift = PyObject . From ( options . FlowShift ) )
176175 using ( var strength = PyObject . From ( options . Strength ) )
177176 using ( var loraOptions = PyObject . From ( loraConfig ) )
178177 using ( var inputData = PyObject . From ( imageInput ? . Memory . ToArray ( ) ) )
179178 using ( var inputShape = PyObject . From ( imageInput ? . Dimensions . ToArray ( ) ) )
180- using ( var pythonResult = _functionGenerate . Call ( prompt , negativePrompt , guidance , guidance2 , steps , steps2 , height , width , seed , scheduler , numFrames , shift , flowShift , strength , loraOptions , inputData , inputShape ) )
179+ using ( var pythonResult = _functionGenerate . Call ( prompt , negativePrompt , guidance , guidance2 , steps , steps2 , height , width , seed , scheduler , numFrames , shift , strength , loraOptions , inputData , inputShape ) )
181180 {
182181 var result = pythonResult
183182 . BareImportAs < IPyBuffer , PyObjectImporters . Buffer > ( )
@@ -330,7 +329,7 @@ private async Task LoggingLoop(int refreshRate)
330329 var logs = await GetLogsAsync ( ) ;
331330 foreach ( var progress in LogParser . ParseLogs ( logs ) )
332331 {
333- _logger ? . LogInformation ( "[PythonRuntime] {message }" , progress . Message ) ;
332+ _logger ? . LogInformation ( "[PythonRuntime] {Message }" , progress . Message ) ;
334333 _progressCallback ? . Report ( progress ) ;
335334 }
336335 await Task . Delay ( refreshRate , _progressCancellation . Token ) ;
@@ -347,6 +346,9 @@ private Exception HandlePythonException(PythonInvocationException ex)
347346 {
348347 if ( ex . InnerException is PythonRuntimeException pyex )
349348 {
349+ if ( ex . InnerException . Message . Equals ( "Operation Canceled" ) )
350+ return new OperationCanceledException ( ) ;
351+
350352 _logger ? . LogError ( pyex , "{PythonExceptionType} exception occured" , ex . PythonExceptionType ) ;
351353 if ( ! pyex . PythonStackTrace . IsNullOrEmpty ( ) )
352354 _logger ? . LogError ( string . Join ( Environment . NewLine , pyex . PythonStackTrace ) ) ;
0 commit comments