Skip to content

Commit

Permalink
refactor: remove --multi-retrieval CLI option
Browse files Browse the repository at this point in the history
Signed-off-by: Xin Liu <[email protected]>
  • Loading branch information
apepkuss committed Nov 5, 2024
1 parent 02ffa0f commit d03ba01
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
6 changes: 2 additions & 4 deletions src/backend/ggml.rs
Original file line number Diff line number Diff line change
@@ -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},
Expand Down Expand Up @@ -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();
Expand Down
11 changes: 0 additions & 11 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ type Error = Box<dyn std::error::Error + Send + Sync + 'static>;
pub(crate) static GLOBAL_RAG_PROMPT: OnceCell<String> = OnceCell::new();
// server info
pub(crate) static SERVER_INFO: OnceCell<ServerInfo> = OnceCell::new();
// allow multi-retrieval
pub(crate) static MULTI_RETRIEVAL: OnceCell<bool> = OnceCell::new();

// default port
const DEFAULT_PORT: &str = "8080";
Expand Down Expand Up @@ -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<SocketAddr>,
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit d03ba01

Please sign in to comment.