aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore3
-rw-r--r--swr2_asr/utils/decoder.py1
-rw-r--r--swr2_asr/utils/tokenizer.py6
3 files changed, 8 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index 6e14acc..485df5b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -67,8 +67,7 @@ cover/
*.mo
*.pot
-#Model
-YOUR
+
# Django stuff:
*.log
diff --git a/swr2_asr/utils/decoder.py b/swr2_asr/utils/decoder.py
index fcddb79..ef8de49 100644
--- a/swr2_asr/utils/decoder.py
+++ b/swr2_asr/utils/decoder.py
@@ -24,3 +24,4 @@ def greedy_decoder(output, labels, label_lengths, tokenizer: CharTokenizer, coll
# TODO: add beam search decoder
+
diff --git a/swr2_asr/utils/tokenizer.py b/swr2_asr/utils/tokenizer.py
index 1cc7b84..ee89cdb 100644
--- a/swr2_asr/utils/tokenizer.py
+++ b/swr2_asr/utils/tokenizer.py
@@ -120,3 +120,9 @@ class CharTokenizer:
load_tokenizer.char_map[char] = int(index)
load_tokenizer.index_map[int(index)] = char
return load_tokenizer
+
+ def create_txt(self,path:str):
+ with open(path, 'w',encoding="utf-8") as file:
+ for key,value in self.char_map():
+ file.write(f"{key}\n")
+ \ No newline at end of file