From a1154b17ec8489ad77217af8cf52027e9413ecb6 Mon Sep 17 00:00:00 2001 From: Morgan Funtowicz Date: Tue, 5 Nov 2024 23:47:38 +0100 Subject: [PATCH] feat(backend): avoid copy constructor --- backends/llamacpp/csrc/ffi.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/backends/llamacpp/csrc/ffi.hpp b/backends/llamacpp/csrc/ffi.hpp index a3d14ee5..9daacf2c 100644 --- a/backends/llamacpp/csrc/ffi.hpp +++ b/backends/llamacpp/csrc/ffi.hpp @@ -101,8 +101,7 @@ namespace huggingface::tgi::backends::llamacpp { params.use_mmap = true; auto *model = llama_load_model_from_file(cxxPath.c_str(), params); - auto backend = single_worker_backend_t(model, std::nullopt); - return std::make_unique(std::move(backend)); + return std::make_unique(single_worker_backend_t { model, std::nullopt }); } }