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