Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
tiero committed Oct 24, 2023
1 parent c34391d commit 8b74981
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ struct TranscribeArgs {
async fn main() {
let opts = Opts::parse();
match opts.subcmd {
SubCommand::Serve { port, model_path} => {
SubCommand::Serve { port, model_path } => {
let model_path = Path::new(&model_path);
start_server(port, &model_path).await;
}
Expand All @@ -84,13 +84,15 @@ async fn main() {
async fn start_server(port: u16, model_path: &Path) {
// load model
let whisper = Arc::new(Mutex::new(
Whisper::from_model_path(model_path, Some(Language::Auto)).await
Whisper::from_model_path(model_path, Some(Language::Auto)).await,
));

let make_svc = make_service_fn(move |_conn| {
let whisper_clone = whisper.clone();
async move {
Ok::<_, Infallible>(service_fn(move |req| handle_transcription(req, whisper_clone.clone())))
Ok::<_, Infallible>(service_fn(move |req| {
handle_transcription(req, whisper_clone.clone())
}))
}
});

Expand Down

0 comments on commit 8b74981

Please sign in to comment.