text-generation-inference/backends/llamacpp/src/lib.rs

18 lines
500 B
Rust
Raw Normal View History

2024-10-04 08:42:31 +00:00
pub mod backend;
#[cxx::bridge(namespace = "huggingface::tgi::backends::llamacpp::impl")]
2024-10-04 08:42:31 +00:00
mod ffi {
unsafe extern "C++" {
2024-10-24 07:56:40 +00:00
include!("backends/llamacpp/csrc/ffi.hpp");
2024-10-04 08:42:31 +00:00
/// Represent an instance of the llama.cpp backend instance on C++ side
type LlamaCppBackendImpl;
2024-10-24 07:56:40 +00:00
#[rust_name = "create_llamacpp_backend"]
fn CreateLlamaCppBackendImpl(
modelPath: &str,
n_threads: u16,
) -> Result<UniquePtr<LlamaCppBackendImpl>>;
2024-10-04 08:42:31 +00:00
}
}