From 659ad8f48b68c5cb3243a12cebce3f0ce08b3ff6 Mon Sep 17 00:00:00 2001
From: zhifu gao <zhifu.gzf@alibaba-inc.com>
Date: 星期一, 06 三月 2023 17:21:40 +0800
Subject: [PATCH] Merge pull request #189 from yuekaizhang/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