diff --git a/src/backend/ggml.rs b/src/backend/ggml.rs index 2ea41ad..420e85a 100644 --- a/src/backend/ggml.rs +++ b/src/backend/ggml.rs @@ -1,6 +1,4 @@ -use crate::{ - error, utils::gen_chat_id, ServerInfo, GLOBAL_RAG_PROMPT, MULTI_RETRIEVAL, SERVER_INFO, -}; +use crate::{error, utils::gen_chat_id, ServerInfo, GLOBAL_RAG_PROMPT, SERVER_INFO}; use chat_prompts::{error as ChatPromptsError, MergeRagContext, MergeRagContextPolicy}; use endpoints::{ chat::{ChatCompletionRequest, ChatCompletionRequestMessage, ChatCompletionUserMessageContent}, @@ -486,7 +484,7 @@ async fn retrieve_context( } // join the user messages in the context window into a single string - let query_text = if last_messages.len() > 0 { + let query_text = if !last_messages.is_empty() { info!(target: "stdout", "Found the latest {} user messages.", last_messages.len()); last_messages.reverse(); diff --git a/src/main.rs b/src/main.rs index 2673121..75612c0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -29,8 +29,6 @@ type Error = Box; pub(crate) static GLOBAL_RAG_PROMPT: OnceCell = OnceCell::new(); // server info pub(crate) static SERVER_INFO: OnceCell = OnceCell::new(); -// allow multi-retrieval -pub(crate) static MULTI_RETRIEVAL: OnceCell = OnceCell::new(); // default port const DEFAULT_PORT: &str = "8080"; @@ -115,9 +113,6 @@ struct Cli { /// Maximum number of tokens each chunk contains #[arg(long, default_value = "100", value_parser = clap::value_parser!(usize))] chunk_capacity: usize, - /// Allow multi-retrieval - #[arg(long, default_value = "true")] - multi_retrieval: bool, /// Socket address of LlamaEdge-RAG API Server instance. For example, `0.0.0.0:8080`. #[arg(long, default_value = None, value_parser = clap::value_parser!(SocketAddr), group = "socket_address_group")] socket_addr: Option, @@ -300,12 +295,6 @@ async fn main() -> Result<(), ServerError> { // log chunk capacity info!(target: "stdout", "chunk_capacity: {}", &cli.chunk_capacity); - // log multi-retrieval - info!(target: "stdout", "multi_retrieval: {}", &cli.multi_retrieval); - MULTI_RETRIEVAL - .set(cli.multi_retrieval) - .map_err(|_| ServerError::Operation("Failed to set `MULTI_RETRIEVAL`.".to_string()))?; - // RAG policy info!(target: "stdout", "rag_policy: {}", &cli.policy);