update fmt

This commit is contained in:
jhqxxx
2026-03-31 13:08:25 +08:00
parent 3e510a4172
commit c5551e7fb8
12 changed files with 12 additions and 15 deletions
+1 -1
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -1,2 +1,2 @@
pub mod chat;
pub mod shared;
pub mod shared;
-1
View File
@@ -1,4 +1,3 @@
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
-1
View File
@@ -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
+1 -1
View File
@@ -38,7 +38,7 @@ fn messy_test() -> Result<()> {
// RUST_BACKTRACE=1 cargo test -F cuda --test messy_test messy_test -r -- --nocapture
println!("当前秒级时间戳: {}", timestamp());
println!("当前毫秒级时间戳: {}", timestamp_millis());
// let t1 = Tensor::randn(0.0, 1.0, (1, 2, 6), device)?;
// println!(" t1: {}", t1);
// let t2 = t1.pad_with_zeros(D::Minus1, -3, 0)?;
+1 -1
View File
@@ -1,7 +1,7 @@
use std::{pin::pin, time::Instant};
use aha::params::chat::ChatCompletionParameters;
use aha::models::{GenerateModel, deepseek_ocr::generate::DeepseekOCRGenerateModel};
use aha::params::chat::ChatCompletionParameters;
use anyhow::Result;
use rocket::futures::StreamExt;
+1 -1
View File
@@ -1,8 +1,8 @@
use std::time::Instant;
use aha::{
params::chat::ChatCompletionParameters,
models::{GenerateModel, qwen3_5::generate::Qwen3_5GenerateModel},
params::chat::ChatCompletionParameters,
};
use anyhow::Result;
// use candle_core::{DType, Device, quantized::gguf_file};
+1 -1
View File
@@ -1,6 +1,6 @@
use aha::{
params::chat::ChatCompletionParameters,
models::{GenerateModel, lfm2::generate::Lfm2GenerateModel},
params::chat::ChatCompletionParameters,
};
use anyhow::Result;
use rocket::futures::StreamExt;
+1 -1
View File
@@ -1,8 +1,8 @@
use std::{pin::pin, time::Instant};
use aha::{
params::chat::ChatCompletionParameters,
models::{GenerateModel, lfm2vl::generate::Lfm2VLGenerateModel},
params::chat::ChatCompletionParameters,
};
use anyhow::Result;
use rocket::futures::StreamExt;