Skip to content

Commit 9934d7a

Browse files
committed
fix: use modern type annotation syntax for upstream compatibility
Signed-off-by: BBC, Esquire <bbc@chintellalaw.com>
1 parent 162e51b commit 9934d7a

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

docling/pipeline/asr_pipeline.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ class _WhisperS2TModel:
388388
def __init__(
389389
self,
390390
enabled: bool,
391-
artifacts_path: Optional[Path],
391+
artifacts_path: Path | None,
392392
accelerator_options: AcceleratorOptions,
393393
asr_options: InlineAsrWhisperS2TOptions,
394394
):
@@ -469,7 +469,7 @@ def _parse_device(self, device_str: str) -> tuple:
469469
def run(self, conv_res: ConversionResult) -> ConversionResult:
470470
path_or_stream = conv_res.input._backend.path_or_stream
471471

472-
temp_file_path: Optional[Path] = None
472+
temp_file_path: Path | None = None
473473

474474
if isinstance(path_or_stream, BytesIO):
475475
suffix = Path(conv_res.input.file.name).suffix or ".wav"
@@ -577,7 +577,7 @@ def __init__(self, pipeline_options: AsrPipelineOptions):
577577
self.keep_backend = True
578578

579579
self.pipeline_options: AsrPipelineOptions = pipeline_options
580-
self._model: Union[_NativeWhisperModel, _MlxWhisperModel, _WhisperS2TModel]
580+
self._model: _NativeWhisperModel | _MlxWhisperModel | _WhisperS2TModel
581581

582582
if isinstance(self.pipeline_options.asr_options, InlineAsrNativeWhisperOptions):
583583
native_asr_options: InlineAsrNativeWhisperOptions = (

0 commit comments

Comments
 (0)