rlx_bert/lib.rs
1// RLX — versatile ML compiler + runtime.
2// Copyright (C) 2026 Eugene Hauptmann, Nataliya Kosmyna.
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, version 3.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU General Public License for more details.
12//
13// You should have received a copy of the GNU General Public License
14// along with this program. If not, see <https://www.gnu.org/licenses/>.
15
16//! BERT encoder graph builder for RLX.
17//!
18//! Lowers a [`rlx_core::config::BertConfig`] + weights into an RLX IR graph via
19//! the shared `rlx_flow::ModelFlow` DSL. This crate only *builds* the graph;
20//! compiling and running it (tokenization, device dispatch, pooling) lives in
21//! consumer crates such as `rlx-embed` and `rlx-clinicalbert`. See the README.
22
23pub mod bert;
24pub mod flow;
25
26#[cfg(test)]
27mod test_support;
28
29pub use bert::build_bert_graph_sized;
30pub use flow::{BertFlow, build_bert_built};