update format

This commit is contained in:
jhqxxx
2025-09-22 23:58:08 +08:00
parent fdfdfedeb4
commit ec989f397f
8 changed files with 31 additions and 23 deletions
+7 -3
View File
@@ -1,7 +1,9 @@
pub mod qwen2_5vl;
use anyhow::Result;
use candle_core::{DType, Device};
use openai_dive::v1::resources::chat::{ChatCompletionChunkResponse, ChatCompletionParameters, ChatCompletionResponse};
use openai_dive::v1::resources::chat::{
ChatCompletionChunkResponse, ChatCompletionParameters, ChatCompletionResponse,
};
use rocket::futures::Stream;
pub trait GenerateModel {
@@ -9,6 +11,8 @@ pub trait GenerateModel {
where
Self: Sized;
fn generate(&mut self, mes: ChatCompletionParameters) -> Result<ChatCompletionResponse>;
fn generate_stream(&mut self, mes: ChatCompletionParameters) -> Result<impl Stream<Item = Result<ChatCompletionChunkResponse, anyhow::Error>>>;
fn generate_stream(
&mut self,
mes: ChatCompletionParameters,
) -> Result<impl Stream<Item = Result<ChatCompletionChunkResponse, anyhow::Error>>>;
}
+1 -1
View File
@@ -1,4 +1,4 @@
pub mod config;
pub mod generate;
pub mod model;
pub mod processor;
pub mod generate;
+1 -1
View File
@@ -1 +1 @@
pub mod tokenizer;
pub mod tokenizer;
+1
View File
@@ -0,0 +1 @@
+2 -2
View File
@@ -1,4 +1,4 @@
pub mod img_utils;
pub mod tensor_utils;
pub mod utils;
pub mod img_utils;
pub mod video_utils;
pub mod video_utils;
+3 -1
View File
@@ -3,7 +3,9 @@ use candle_core::{DType, Device};
use candle_transformers::generation::LogitsProcessor;
use openai_dive::v1::resources::{
chat::{
ChatCompletionChoice, ChatCompletionChunkChoice, ChatCompletionChunkResponse, ChatCompletionResponse, ChatMessage, ChatMessageContent, DeltaChatMessage, DeltaFunction, DeltaToolCall, Function, ToolCall
ChatCompletionChoice, ChatCompletionChunkChoice, ChatCompletionChunkResponse,
ChatCompletionResponse, ChatMessage, ChatMessageContent, DeltaChatMessage, DeltaFunction,
DeltaToolCall, Function, ToolCall,
},
shared::FinishReason,
};