Skip to content

Commit 8375fc2

Browse files
committed
Add warning for onnxruntime 1.24 symlinks problem
1 parent 0044bde commit 8375fc2

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

src/onnx_asr/loader.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,18 @@ def create_preprocessor(name: str) -> Preprocessor:
301301
return preprocessor
302302
return ConcurrentPreprocessor(preprocessor, max_concurrent_workers)
303303

304+
model_files = self.resolve_model(quantization=quantization)
305+
if rt.__version__.startswith("1.24") and any(
306+
file for path in model_files.values() for file in path.parent.glob("*.onnx?data") if file.is_symlink()
307+
):
308+
warnings.warn(
309+
"Onnxruntime 1.24 does not allow symlinks to data files used in the HuggingFace cache. "
310+
"Please specify the path to where the model will be downloaded.",
311+
stacklevel=2,
312+
)
313+
304314
return TextResultsAsrAdapter(
305-
self._model_type(self.resolve_model(quantization=quantization), create_preprocessor, asr_config),
315+
self._model_type(model_files, create_preprocessor, asr_config),
306316
Resampler(self._model_type._get_sample_rate(), resampler_config),
307317
)
308318

0 commit comments

Comments
 (0)