From b18f7d121f2f17df8bf2d0c2bbb223bc5ddbcc0f Mon Sep 17 00:00:00 2001
From: 游雁 <zhifu.gzf@alibaba-inc.com>
Date: 星期四, 25 五月 2023 16:11:22 +0800
Subject: [PATCH] docs
---
funasr/runtime/onnxruntime/src/vocab.cpp | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/funasr/runtime/onnxruntime/src/vocab.cpp b/funasr/runtime/onnxruntime/src/vocab.cpp
index ba041b8..65af8b6 100644
--- a/funasr/runtime/onnxruntime/src/vocab.cpp
+++ b/funasr/runtime/onnxruntime/src/vocab.cpp
@@ -1,5 +1,6 @@
#include "vocab.h"
-#include "yaml-cpp/yaml.h"
+#include <yaml-cpp/yaml.h>
+#include <glog/logging.h>
#include <fstream>
#include <iostream>
@@ -9,6 +10,7 @@
using namespace std;
+namespace funasr {
Vocab::Vocab(const char *filename)
{
ifstream in(filename);
@@ -22,8 +24,8 @@
YAML::Node config;
try{
config = YAML::LoadFile(filename);
- }catch(...){
- printf("error loading file, yaml file error or not exist.\n");
+ }catch(exception const &e){
+ LOG(INFO) << "Error loading file, yaml file error or not exist.";
exit(-1);
}
YAML::Node myList = config["token_list"];
@@ -150,3 +152,5 @@
{
return vocab.size();
}
+
+} // namespace funasr
\ No newline at end of file
--
Gitblit v1.9.1