From 80e6c258cf89b5f11f4e52a4cc5a9cf2e95aa7be Mon Sep 17 00:00:00 2001
From: Yuekai Zhang <zhangyuekai@foxmail.com>
Date: 星期一, 06 三月 2023 16:48:02 +0800
Subject: [PATCH] update token list

---
 funasr/runtime/triton_gpu/model_repo_paraformer_large_offline/scoring/1/model.py |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/funasr/runtime/triton_gpu/model_repo_paraformer_large_offline/scoring/1/model.py b/funasr/runtime/triton_gpu/model_repo_paraformer_large_offline/scoring/1/model.py
index 0377033..ef6278d 100644
--- a/funasr/runtime/triton_gpu/model_repo_paraformer_large_offline/scoring/1/model.py
+++ b/funasr/runtime/triton_gpu/model_repo_paraformer_large_offline/scoring/1/model.py
@@ -21,6 +21,7 @@
 
 import json
 import os
+import yaml
 
 class TritonPythonModel:
     """Your Python model must use the same class name. Every Python model
@@ -73,9 +74,9 @@
         """
         load lang_char.txt
         """
-        with open(str(vocab_file), 'r') as f:
-            token_list = [line.strip() for line in f]
-        return token_list
+        with open(str(vocab_file), 'rb') as f:
+            config = yaml.load(f, Loader=yaml.Loader)
+        return config['token_list']
 
     def execute(self, requests):
         """`execute` must be implemented in every Python model. `execute`

--
Gitblit v1.9.1