encoderfile 0.4.0-rc.1

Distribute and run transformer encoders with a single file.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use crate::{
    common::{GetModelMetadataResponse, model_type::ModelTypeSpec},
    runtime::AppState,
};

pub fn get_model_metadata<T: ModelTypeSpec>(state: &AppState<T>) -> GetModelMetadataResponse {
    GetModelMetadataResponse {
        model_id: state.config.name.clone(),
        model_type: T::enum_val(),
        id2label: state.model_config.id2label.clone(),
    }
}