WarriorsSami's picture
perf: replace metal with wgpu support and add http file for predict request
1c9f6e9
raw
history blame
546 Bytes
#![recursion_limit = "256"]
#![allow(unexpected_cfgs)]
use crate::api::{AppState, BackendImpl, predict};
use model::data::TweetSentimentDataset;
use model::model::SamModel;
use rocket::tokio::sync::Mutex;
use rocket::{launch, routes};
use std::sync::Arc;
mod api;
mod dtos;
#[launch]
fn rocket() -> _ {
let model = Arc::new(Mutex::new(
SamModel::<BackendImpl, TweetSentimentDataset>::new(Default::default(), "sam-artifacts"),
));
rocket::build()
.manage(AppState { model })
.mount("/", routes![predict])
}