diff --git a/speechbrain/lm/arpa.py b/speechbrain/lm/arpa.py index c9b0ea54e7..540b1cb50d 100644 --- a/speechbrain/lm/arpa.py +++ b/speechbrain/lm/arpa.py @@ -325,6 +325,11 @@ def arpa_to_fst( "Install using `pip install kaldilm`." ) + if isinstance(out_fst, str): + out_fst = Path(out_fst) + if isinstance(in_arpa, str): + in_arpa = Path(in_arpa) + if cache and out_fst.exists(): return if not in_arpa.exists():