From bbaf4987861b225d4e603ddfe752b39289871334 Mon Sep 17 00:00:00 2001 From: Rogier van Dalen Date: Thu, 15 May 2025 11:51:28 +0100 Subject: [PATCH] Make arpa_to_fst work when arguments are str --- speechbrain/lm/arpa.py | 5 +++++ 1 file changed, 5 insertions(+) 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():