diff --git a/examples/perplexity/perplexity.cpp b/examples/perplexity/perplexity.cpp index cf87cf5a9..2c0ff9fbd 100644 --- a/examples/perplexity/perplexity.cpp +++ b/examples/perplexity/perplexity.cpp @@ -1221,7 +1221,7 @@ static bool deserialize_string(std::istream & in, std::string & str) { uint32_t size; if (!in.read((char *)&size, sizeof(size)).fail()) { str.resize(size); - if (!in.read((char *)str.data(), size).fail()) return true; + if (!in.read((char *)&str[0], size).fail()) return true; } return false; } diff --git a/examples/server/server.cpp b/examples/server/server.cpp index ad47e3703..b7bd9d4df 100644 --- a/examples/server/server.cpp +++ b/examples/server/server.cpp @@ -2822,17 +2822,19 @@ int main(int argc, char **argv) }*/ //); - llama.queue_tasks.on_new_task([ObjectPtr = &llama](auto&& PH1) { - ObjectPtr->process_single_task(std::forward(PH1)); - }); - llama.queue_tasks.on_finish_multitask([ObjectPtr = &llama](auto&& PH1) { - ObjectPtr->on_finish_multitask(std::forward(PH1)); - }); - llama.queue_tasks.on_all_tasks_finished([ObjectPtr = &llama] { ObjectPtr->run_on_all_tasks_finished(); }); - llama.queue_results.on_multitask_update([ObjectPtr = &llama.queue_tasks](auto&& PH1, auto&& PH2, auto&& PH3) { - ObjectPtr->update_multitask(std::forward(PH1), std::forward(PH2), - std::forward(PH3)); - }); + llama.queue_tasks.on_new_task(std::bind( + &llama_server_context::process_single_task, &llama, std::placeholders::_1)); + llama.queue_tasks.on_finish_multitask(std::bind( + &llama_server_context::on_finish_multitask, &llama, std::placeholders::_1)); + llama.queue_tasks.on_all_tasks_finished(std::bind( + &llama_server_context::run_on_all_tasks_finished, &llama)); + llama.queue_results.on_multitask_update(std::bind( + &llama_server_queue::update_multitask, + &llama.queue_tasks, + std::placeholders::_1, + std::placeholders::_2, + std::placeholders::_3 + )); llama.queue_tasks.start_loop(); t.join();