File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
projects/llm_framework/main_cosy_voice/src/runner/Tokenizer Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -349,11 +349,17 @@ class Tokenizer_Http : public BaseTokenizer {
349349 bool Init (std::string model_path = " http://localhost:8080" , bool b_bos = true , bool b_eos = false ) override
350350 {
351351 base_url = model_path;
352+ if (!test_connect_http (base_url, 20 )) {
353+ ALOGE (" connect %s failed" , base_url.c_str ());
354+ return false ;
355+ } else {
356+ ALOGI (" connect %s ok" , base_url.c_str ());
357+ }
352358 try {
353359 cli = std::make_shared<httplib::Client>(base_url);
354- cli->set_connection_timeout (1 );
355- cli->set_read_timeout (1 );
356- cli->set_write_timeout (1 );
360+ cli->set_connection_timeout (10 );
361+ cli->set_read_timeout (10 );
362+ cli->set_write_timeout (10 );
357363 {
358364 auto ret = cli->Get (" /bos_id" );
359365 auto rep = ret.value ();
You can’t perform that action at this time.
0 commit comments