Skip to content

Commit 089bfaf

Browse files
committed
[fix] Increase tokenizer init timeout.
1 parent 324de59 commit 089bfaf

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

projects/llm_framework/main_llm/src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ class llm_task {
134134
tokenizer_server_flage_ = true;
135135
SLOGI("port_=%s model_id=%s content=%s", std::to_string(port_).c_str(),
136136
(base_model + "tokenizer").c_str(), ("'" + prompt_ + "'").c_str());
137-
std::this_thread::sleep_for(std::chrono::seconds(10));
137+
std::this_thread::sleep_for(std::chrono::seconds(15));
138138
}
139139
} else {
140140
mode_config_.filename_tokenizer_model = base_model + mode_config_.filename_tokenizer_model;

projects/llm_framework/main_vlm/src/main.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ class llm_task {
140140
tokenizer_server_flage_ = true;
141141
SLOGI("port_=%s model_id=%s content=%s", std::to_string(port_).c_str(),
142142
(base_model + "tokenizer").c_str(), ("'" + prompt_ + "'").c_str());
143-
std::this_thread::sleep_for(std::chrono::seconds(10));
143+
std::this_thread::sleep_for(std::chrono::seconds(15));
144144
}
145145
} else {
146146
mode_config_.filename_tokenizer_model = base_model + mode_config_.filename_tokenizer_model;
@@ -207,6 +207,7 @@ class llm_task {
207207
lLaMa_->Encode(src, img_embed);
208208
lLaMa_->Encode(img_embed, prompt_data_, prompt_complete(msg));
209209
std::string out = lLaMa_->Run(prompt_data_);
210+
if (out_callback_) out_callback_(out, true);
210211
}
211212
} catch (...) {
212213
SLOGW("lLaMa_->Run have error!");
@@ -232,6 +233,9 @@ class llm_task {
232233

233234
~llm_task()
234235
{
236+
if (lLaMa_) {
237+
lLaMa_->Deinit();
238+
}
235239
}
236240
};
237241

0 commit comments

Comments
 (0)