bindings.cc 630 Bytes
Newer Older
1
#include <pybind11/pybind11.h>
2

PanZezhong's avatar
PanZezhong committed
3
4
#include "cache/cache.hpp"
#include "engine/engine.hpp"
5
6
#include "models/llama.hpp"

7
8
namespace py = pybind11;

9
PYBIND11_MODULE(_infinilm, m) {
10
11
    m.doc() = "InfiniLM Llama model Python bindings";

yaoht's avatar
yaoht committed
12
13
14
15
16
    // Import _infinicore first so that its pybind11 types
    // (DataType, Device::Type, etc.) are registered in the
    // global type map before _infinilm tries to use them.
    py::module_::import("infinicore");

PanZezhong's avatar
PanZezhong committed
17
    infinilm::cache::bind_cache(m);
18
    infinilm::models::llama::bind_llama(m);
19
20
    infinilm::engine::distributed::bind_dist_config(m);
    infinilm::engine::bind_infer_engine(m);
21
}