游雁
2023-05-08 2a475a112f4d765609939089fcaf0bca8f34e1e4
funasr/runtime/onnxruntime/src/tokenizer.cpp
@@ -14,6 +14,10 @@
{
}
CTokenizer::~CTokenizer()
{
}
void CTokenizer::ReadYaml(const YAML::Node& node) 
{
   if (node.IsMap()) 
@@ -29,15 +33,20 @@
      }
   }
   if (node.IsScalar()) {//�DZ�����
      cout << node.as<string>() << endl;
      LOG(INFO) << node.as<string>();
   }
}
bool CTokenizer::OpenYaml(const char* sz_yamlfile)
{
   YAML::Node m_Config = YAML::LoadFile(sz_yamlfile);
   if (m_Config.IsNull())
      return false;
   YAML::Node m_Config;
   try{
      m_Config = YAML::LoadFile(sz_yamlfile);
   }catch(exception const &e){
        LOG(INFO) << "Error loading file, yaml file error or not exist.";
        exit(-1);
    }
   try
   {
      auto Tokens = m_Config["token_list"];
@@ -66,7 +75,7 @@
      }
   }
   catch (YAML::BadFile& e) {
      std::cout << "read error!" << std::endl;
      LOG(ERROR) << "Read error!";
      return  false;
   }
   m_ready = true;