From f660fcf7157d5174a316bb95522517355f34fd18 Mon Sep 17 00:00:00 2001 From: drbh Date: Fri, 26 Jan 2024 10:47:17 -0500 Subject: [PATCH 1/6] feat: add tokenizer-config-path to launcher args --- launcher/src/main.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/launcher/src/main.rs b/launcher/src/main.rs index 09657c91550..796adea81d9 100644 --- a/launcher/src/main.rs +++ b/launcher/src/main.rs @@ -371,6 +371,10 @@ struct Args { /// Display a lot of information about your runtime environment #[clap(long, short, action)] env: bool, + + /// path to the tokenizer config file + #[clap(long, env)] + tokenizer_config_path: Option, } #[derive(Debug)] @@ -1016,6 +1020,12 @@ fn spawn_webserver( args.model_id, ]; + // Tokenizer config path + if let Some(ref tokenizer_config_path) = args.tokenizer_config_path { + router_args.push("--tokenizer-config-path".to_string()); + router_args.push(tokenizer_config_path.to_string()); + } + // Model optional max batch total tokens if let Some(max_batch_total_tokens) = args.max_batch_total_tokens { router_args.push("--max-batch-total-tokens".to_string()); From f7a8454d43594e95150fee3c7d198ec1c2eb4430 Mon Sep 17 00:00:00 2001 From: drbh Date: Fri, 26 Jan 2024 10:55:35 -0500 Subject: [PATCH 2/6] fix: update docs and move arg position in file --- docs/source/basic_tutorials/launcher.md | 8 ++++++++ launcher/src/main.rs | 8 ++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/docs/source/basic_tutorials/launcher.md b/docs/source/basic_tutorials/launcher.md index bafe3669219..747b924b0b7 100644 --- a/docs/source/basic_tutorials/launcher.md +++ b/docs/source/basic_tutorials/launcher.md @@ -354,6 +354,14 @@ Options: [env: NGROK_EDGE=] +``` +### TOKENIZER_CONFIG_PATH +```shell + --tokenizer-config-path + The path to the tokenizer config file. This path is used to load the tokenizer configuration which may include a `chat_template`. If not provided, the default config will be used from the model hub. + + [env: TOKENIZER_CONFIG_PATH=] + ``` ## ENV ```shell diff --git a/launcher/src/main.rs b/launcher/src/main.rs index 796adea81d9..b47b24fa745 100644 --- a/launcher/src/main.rs +++ b/launcher/src/main.rs @@ -368,13 +368,13 @@ struct Args { #[clap(long, env)] ngrok_edge: Option, - /// Display a lot of information about your runtime environment - #[clap(long, short, action)] - env: bool, - /// path to the tokenizer config file #[clap(long, env)] tokenizer_config_path: Option, + + /// Display a lot of information about your runtime environment + #[clap(long, short, action)] + env: bool, } #[derive(Debug)] From 66292828e6c26fa0c52996a52691aad20cb2b10b Mon Sep 17 00:00:00 2001 From: drbh Date: Fri, 26 Jan 2024 10:57:53 -0500 Subject: [PATCH 3/6] fix: correct comment typo --- launcher/src/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/launcher/src/main.rs b/launcher/src/main.rs index b47b24fa745..95b73f75901 100644 --- a/launcher/src/main.rs +++ b/launcher/src/main.rs @@ -372,7 +372,8 @@ struct Args { #[clap(long, env)] tokenizer_config_path: Option, - /// Display a lot of information about your runtime environment + /// The path to the tokenizer config file. This path is used to load the tokenizer configuration which may + /// include a `chat_template`. If not provided, the default config will be used from the model hub. #[clap(long, short, action)] env: bool, } From b6cfb1dd75bdba4323f2e1948c5da0f5c5d1ce0b Mon Sep 17 00:00:00 2001 From: drbh Date: Fri, 26 Jan 2024 11:04:53 -0500 Subject: [PATCH 4/6] fix: remove trailing space (cargo fmt) --- launcher/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launcher/src/main.rs b/launcher/src/main.rs index 95b73f75901..7205dc9a7c0 100644 --- a/launcher/src/main.rs +++ b/launcher/src/main.rs @@ -372,7 +372,7 @@ struct Args { #[clap(long, env)] tokenizer_config_path: Option, - /// The path to the tokenizer config file. This path is used to load the tokenizer configuration which may + /// The path to the tokenizer config file. This path is used to load the tokenizer configuration which may /// include a `chat_template`. If not provided, the default config will be used from the model hub. #[clap(long, short, action)] env: bool, From 6d34bfcef54ff6315110310b1a0477b239b0943c Mon Sep 17 00:00:00 2001 From: drbh Date: Fri, 26 Jan 2024 11:11:35 -0500 Subject: [PATCH 5/6] fix: replace accidental deletion and fix docs again --- docs/source/basic_tutorials/launcher.md | 6 +++--- launcher/src/main.rs | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/source/basic_tutorials/launcher.md b/docs/source/basic_tutorials/launcher.md index 747b924b0b7..712b4fc43d8 100644 --- a/docs/source/basic_tutorials/launcher.md +++ b/docs/source/basic_tutorials/launcher.md @@ -355,13 +355,13 @@ Options: [env: NGROK_EDGE=] ``` -### TOKENIZER_CONFIG_PATH +## TOKENIZER_CONFIG_PATH ```shell --tokenizer-config-path - The path to the tokenizer config file. This path is used to load the tokenizer configuration which may include a `chat_template`. If not provided, the default config will be used from the model hub. + The path to the tokenizer config file. This path is used to load the tokenizer configuration which may include a `chat_template`. If not provided, the default config will be used from the model hub [env: TOKENIZER_CONFIG_PATH=] - + ``` ## ENV ```shell diff --git a/launcher/src/main.rs b/launcher/src/main.rs index 7205dc9a7c0..d2410a66c34 100644 --- a/launcher/src/main.rs +++ b/launcher/src/main.rs @@ -368,12 +368,12 @@ struct Args { #[clap(long, env)] ngrok_edge: Option, - /// path to the tokenizer config file - #[clap(long, env)] - tokenizer_config_path: Option, - /// The path to the tokenizer config file. This path is used to load the tokenizer configuration which may /// include a `chat_template`. If not provided, the default config will be used from the model hub. + #[clap(long, env)] + tokenizer_config_path: Option, + + /// Display a lot of information about your runtime environment #[clap(long, short, action)] env: bool, } From e9e771c3dbee0943f8edc368e733e9029cbce7f9 Mon Sep 17 00:00:00 2001 From: drbh Date: Fri, 26 Jan 2024 11:28:04 -0500 Subject: [PATCH 6/6] chore: remove extra space (cargo fmt) --- launcher/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launcher/src/main.rs b/launcher/src/main.rs index d2410a66c34..f0e45141157 100644 --- a/launcher/src/main.rs +++ b/launcher/src/main.rs @@ -372,7 +372,7 @@ struct Args { /// include a `chat_template`. If not provided, the default config will be used from the model hub. #[clap(long, env)] tokenizer_config_path: Option, - + /// Display a lot of information about your runtime environment #[clap(long, short, action)] env: bool,