Merge branch 'pr/happynewplay/41'
This commit is contained in:
@@ -27,7 +27,9 @@ impl ExecModel for FunASRNanoExec {
|
||||
println!("Time elapsed in load model is: {:?}", i_duration);
|
||||
|
||||
// Create ChatCompletionParameters for ASR
|
||||
let url = &input[1];
|
||||
let url = input.get(1).ok_or_else(|| {
|
||||
anyhow::anyhow!("fun-asr-nano requires a second input: audio path or URL")
|
||||
})?;
|
||||
let input_url = if url.starts_with("http://")
|
||||
|| url.starts_with("https://")
|
||||
|| url.starts_with("file://")
|
||||
|
||||
@@ -28,7 +28,9 @@ impl ExecModel for GlmASRNanoExec {
|
||||
|
||||
// Create ChatCompletionParameters for ASR
|
||||
// Input should be an audio file path
|
||||
let url = &input[1];
|
||||
let url = input.get(1).ok_or_else(|| {
|
||||
anyhow::anyhow!("glm-asr-nano requires a second input: audio path or URL")
|
||||
})?;
|
||||
let input_url = if url.starts_with("http://")
|
||||
|| url.starts_with("https://")
|
||||
|| url.starts_with("file://")
|
||||
|
||||
@@ -19,7 +19,9 @@ impl ExecModel for Qwen2_5VLExec {
|
||||
} else {
|
||||
input_text.clone()
|
||||
};
|
||||
let url = &input[1];
|
||||
let url = input.get(1).ok_or_else(|| {
|
||||
anyhow::anyhow!("qwen2.5vl requires a second input: image path or URL")
|
||||
})?;
|
||||
let input_url = if url.starts_with("http://")
|
||||
|| url.starts_with("https://")
|
||||
|| url.starts_with("file://")
|
||||
|
||||
+10
-7
@@ -98,14 +98,16 @@ impl<'a> GenerateModel for ModelInstance<'a> {
|
||||
ModelInstance::Lfm2VL(model) => model.generate(mes),
|
||||
ModelInstance::Qwen2_5VL(model) => model.generate(mes),
|
||||
ModelInstance::Qwen3(model) => model.generate(mes),
|
||||
ModelInstance::Qwen3_5(model) => model.generate(mes),
|
||||
|
||||
ModelInstance::Qwen3Embedding(_) => {
|
||||
Err(anyhow!("embedding model does not support chat completions"))
|
||||
}
|
||||
ModelInstance::Qwen3ASR(model) => model.generate(mes),
|
||||
ModelInstance::Qwen3Reranker(_) => {
|
||||
Err(anyhow!("reranker model does not support chat completions"))
|
||||
}
|
||||
ModelInstance::Qwen3_5(model) => model.generate(mes),
|
||||
|
||||
ModelInstance::Qwen3ASR(model) => model.generate(mes),
|
||||
ModelInstance::Qwen3VL(model) => model.generate(mes),
|
||||
ModelInstance::DeepSeekOCR(model) => model.generate(mes),
|
||||
ModelInstance::HunyuanOCR(model) => model.generate(mes),
|
||||
@@ -138,14 +140,15 @@ impl<'a> GenerateModel for ModelInstance<'a> {
|
||||
ModelInstance::Lfm2VL(model) => model.generate_stream(mes),
|
||||
ModelInstance::Qwen2_5VL(model) => model.generate_stream(mes),
|
||||
ModelInstance::Qwen3(model) => model.generate_stream(mes),
|
||||
ModelInstance::Qwen3_5(model) => model.generate_stream(mes),
|
||||
ModelInstance::Qwen3ASR(model) => model.generate_stream(mes),
|
||||
|
||||
ModelInstance::Qwen3Embedding(_) => Err(anyhow!(
|
||||
"embedding model does not support streaming chat completions"
|
||||
)),
|
||||
ModelInstance::Qwen3Reranker(_) => {
|
||||
Err(anyhow!("reranker model does not support chat completions"))
|
||||
}
|
||||
ModelInstance::Qwen3Reranker(_) => Err(anyhow!(
|
||||
"reranker model does not support streaming chat completions"
|
||||
)),
|
||||
ModelInstance::Qwen3_5(model) => model.generate_stream(mes),
|
||||
ModelInstance::Qwen3ASR(model) => model.generate_stream(mes),
|
||||
ModelInstance::Qwen3VL(model) => model.generate_stream(mes),
|
||||
ModelInstance::DeepSeekOCR(model) => model.generate_stream(mes),
|
||||
ModelInstance::HunyuanOCR(model) => model.generate_stream(mes),
|
||||
|
||||
Reference in New Issue
Block a user