update fmt
This commit is contained in:
+1
-1
@@ -1,11 +1,11 @@
|
|||||||
// OpenAI-compatible ASR (Automatic Speech Recognition) API endpoint
|
// OpenAI-compatible ASR (Automatic Speech Recognition) API endpoint
|
||||||
// Implements POST /audio/transcriptions and /v1/audio/transcriptions
|
// Implements POST /audio/transcriptions and /v1/audio/transcriptions
|
||||||
|
|
||||||
|
use aha::models::GenerateModel;
|
||||||
use aha::params::chat::{
|
use aha::params::chat::{
|
||||||
AudioUrlType, ChatCompletionParameters, ChatMessage, ChatMessageAudioContentPart,
|
AudioUrlType, ChatCompletionParameters, ChatMessage, ChatMessageAudioContentPart,
|
||||||
ChatMessageContent, ChatMessageContentPart,
|
ChatMessageContent, ChatMessageContentPart,
|
||||||
};
|
};
|
||||||
use aha::models::GenerateModel;
|
|
||||||
use aha::utils::{clean_asr_response, map_language_code};
|
use aha::utils::{clean_asr_response, map_language_code};
|
||||||
use rocket::http::Status;
|
use rocket::http::Status;
|
||||||
use rocket::serde::json::Json;
|
use rocket::serde::json::Json;
|
||||||
|
|||||||
+1
-1
@@ -2,8 +2,8 @@ use std::pin::pin;
|
|||||||
use std::sync::atomic::{AtomicBool, Ordering};
|
use std::sync::atomic::{AtomicBool, Ordering};
|
||||||
use std::sync::{Arc, OnceLock};
|
use std::sync::{Arc, OnceLock};
|
||||||
|
|
||||||
use aha::params::chat::ChatCompletionParameters;
|
|
||||||
use aha::models::{GenerateModel, ModelInstance, WhichModel, load_model};
|
use aha::models::{GenerateModel, ModelInstance, WhichModel, load_model};
|
||||||
|
use aha::params::chat::ChatCompletionParameters;
|
||||||
use aha::process::cleanup_pid_file;
|
use aha::process::cleanup_pid_file;
|
||||||
use aha::utils::string_to_static_str;
|
use aha::utils::string_to_static_str;
|
||||||
use rocket::futures::StreamExt;
|
use rocket::futures::StreamExt;
|
||||||
|
|||||||
+1
-2
@@ -1,9 +1,8 @@
|
|||||||
pub mod chat_template;
|
pub mod chat_template;
|
||||||
pub mod exec;
|
pub mod exec;
|
||||||
pub mod models;
|
pub mod models;
|
||||||
|
pub mod params;
|
||||||
pub mod position_embed;
|
pub mod position_embed;
|
||||||
pub mod process;
|
pub mod process;
|
||||||
pub mod tokenizer;
|
pub mod tokenizer;
|
||||||
pub mod utils;
|
pub mod utils;
|
||||||
pub mod params;
|
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -613,7 +613,7 @@ pub struct ChatMessageImageContentPart {
|
|||||||
/// The type of the content part.
|
/// The type of the content part.
|
||||||
pub r#type: String,
|
pub r#type: String,
|
||||||
/// The text content.
|
/// The text content.
|
||||||
pub image_url: ImageUrlType
|
pub image_url: ImageUrlType,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
|
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
|
||||||
@@ -621,7 +621,7 @@ pub struct ChatMessageAudioContentPart {
|
|||||||
/// The type of the content part. Always input_audio.
|
/// The type of the content part. Always input_audio.
|
||||||
pub r#type: String,
|
pub r#type: String,
|
||||||
/// The input audio data.
|
/// The input audio data.
|
||||||
pub audio_url: AudioUrlType
|
pub audio_url: AudioUrlType,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
|
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
|
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
|
||||||
|
|||||||
@@ -394,7 +394,6 @@ pub fn timestamp_millis() -> u128 {
|
|||||||
.as_millis()
|
.as_millis()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
pub fn round_by_factor(num: u32, factor: u32) -> u32 {
|
pub fn round_by_factor(num: u32, factor: u32) -> u32 {
|
||||||
let round = (num as f32 / factor as f32).round() as u32;
|
let round = (num as f32 / factor as f32).round() as u32;
|
||||||
round * factor
|
round * factor
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
use std::{pin::pin, time::Instant};
|
use std::{pin::pin, time::Instant};
|
||||||
|
|
||||||
use aha::params::chat::ChatCompletionParameters;
|
|
||||||
use aha::models::{GenerateModel, deepseek_ocr::generate::DeepseekOCRGenerateModel};
|
use aha::models::{GenerateModel, deepseek_ocr::generate::DeepseekOCRGenerateModel};
|
||||||
|
use aha::params::chat::ChatCompletionParameters;
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use rocket::futures::StreamExt;
|
use rocket::futures::StreamExt;
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
use std::time::Instant;
|
use std::time::Instant;
|
||||||
|
|
||||||
use aha::{
|
use aha::{
|
||||||
params::chat::ChatCompletionParameters,
|
|
||||||
models::{GenerateModel, qwen3_5::generate::Qwen3_5GenerateModel},
|
models::{GenerateModel, qwen3_5::generate::Qwen3_5GenerateModel},
|
||||||
|
params::chat::ChatCompletionParameters,
|
||||||
};
|
};
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
// use candle_core::{DType, Device, quantized::gguf_file};
|
// use candle_core::{DType, Device, quantized::gguf_file};
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
use aha::{
|
use aha::{
|
||||||
params::chat::ChatCompletionParameters,
|
|
||||||
models::{GenerateModel, lfm2::generate::Lfm2GenerateModel},
|
models::{GenerateModel, lfm2::generate::Lfm2GenerateModel},
|
||||||
|
params::chat::ChatCompletionParameters,
|
||||||
};
|
};
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use rocket::futures::StreamExt;
|
use rocket::futures::StreamExt;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
use std::{pin::pin, time::Instant};
|
use std::{pin::pin, time::Instant};
|
||||||
|
|
||||||
use aha::{
|
use aha::{
|
||||||
params::chat::ChatCompletionParameters,
|
|
||||||
models::{GenerateModel, lfm2vl::generate::Lfm2VLGenerateModel},
|
models::{GenerateModel, lfm2vl::generate::Lfm2VLGenerateModel},
|
||||||
|
params::chat::ChatCompletionParameters,
|
||||||
};
|
};
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use rocket::futures::StreamExt;
|
use rocket::futures::StreamExt;
|
||||||
|
|||||||
Reference in New Issue
Block a user