Skip to content

Commit 9b6581e

Browse files
committed
fix rename
1 parent 363c88c commit 9b6581e

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/main.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,23 @@ struct Args {
2020
model_architecture: llm::ModelArchitecture,
2121
model_path: PathBuf,
2222
#[arg(long, short = 'v')]
23-
vocabulary_path: Option<PathBuf>,
23+
tokenizer_path: Option<PathBuf>,
2424
#[arg(long, short = 'r')]
25-
vocabulary_repository: Option<String>,
25+
tokenizer_repository: Option<String>,
2626
#[arg(long, short = 'h')]
2727
host: String,
2828
#[arg(long, short = 'p')]
2929
port: u16,
3030
}
3131
impl Args {
32-
pub fn to_vocabulary_source(&self) -> llm::VocabularySource {
33-
match (&self.vocabulary_path, &self.vocabulary_repository) {
32+
pub fn to_tokenizer_source(&self) -> llm::TokenizerSource {
33+
match (&self.tokenizer_path, &self.tokenizer_repository) {
3434
(Some(_), Some(_)) => {
35-
panic!("Cannot specify both --vocabulary-path and --vocabulary-repository");
35+
panic!("Cannot specify both --tokenizer-path and --tokenizer-repository");
3636
}
37-
(Some(path), None) => llm::VocabularySource::HuggingFaceTokenizerFile(path.to_owned()),
38-
(None, Some(repo)) => llm::VocabularySource::HuggingFaceRemote(repo.to_owned()),
39-
(None, None) => llm::VocabularySource::Model,
37+
(Some(path), None) => llm::TokenizerSource::HuggingFaceTokenizerFile(path.to_owned()),
38+
(None, Some(repo)) => llm::TokenizerSource::HuggingFaceRemote(repo.to_owned()),
39+
(None, None) => llm::TokenizerSource::Embedded,
4040
}
4141
}
4242
}
@@ -86,13 +86,13 @@ fn infer(
8686
rx_infer: std::sync::mpsc::Receiver<String>,
8787
tx_callback: tokio::sync::mpsc::Sender<llm::InferenceResponse>,
8888
) -> Result<()> {
89-
let vocabulary_source = args.to_vocabulary_source();
89+
let vocabulary_source = args.to_tokenizer_source();
9090
let model_architecture = args.model_architecture;
9191
let model_path = &args.model_path;
9292
let now = std::time::Instant::now();
9393

9494
let llm_model = llm::load_dynamic(
95-
model_architecture,
95+
Some(model_architecture),
9696
&model_path,
9797
vocabulary_source,
9898
Default::default(),

0 commit comments

Comments
 (0)