[Rust Frontend] Switch rustls to native-tls/OpenSSL (#46696)
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
This commit is contained in:
@@ -12,6 +12,7 @@ enum-as-inner.workspace = true
|
||||
futures.workspace = true
|
||||
hf-hub.workspace = true
|
||||
itertools.workspace = true
|
||||
reqwest.workspace = true
|
||||
serde.workspace = true
|
||||
serde_json.workspace = true
|
||||
serde_with.workspace = true
|
||||
|
||||
@@ -21,7 +21,9 @@ tracing.workspace = true
|
||||
[dev-dependencies]
|
||||
criterion.workspace = true
|
||||
hf-hub.workspace = true
|
||||
reqwest.workspace = true
|
||||
tempfile.workspace = true
|
||||
tokio.workspace = true
|
||||
|
||||
[[bench]]
|
||||
name = "hf"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use criterion::{Criterion, Throughput, black_box, criterion_group, criterion_main};
|
||||
use hf_hub::api::sync::ApiBuilder;
|
||||
use hf_hub::api::tokio::ApiBuilder;
|
||||
use tokio::runtime::Runtime;
|
||||
use vllm_tokenizer::{HuggingFaceTokenizer, Tokenizer};
|
||||
|
||||
const MODEL_ID: &str = "Qwen/Qwen3.5-0.8B";
|
||||
@@ -55,13 +56,16 @@ impl BenchFixture {
|
||||
}
|
||||
|
||||
fn tokenizer_json() -> std::path::PathBuf {
|
||||
ApiBuilder::from_env()
|
||||
.with_progress(false)
|
||||
.build()
|
||||
.expect("build hf-hub api")
|
||||
.model(MODEL_ID.to_string())
|
||||
.get("tokenizer.json")
|
||||
.expect("fetch tokenizer.json from hf-hub")
|
||||
Runtime::new().expect("build tokio runtime").block_on(async {
|
||||
ApiBuilder::from_env()
|
||||
.with_progress(false)
|
||||
.build()
|
||||
.expect("build hf-hub api")
|
||||
.model(MODEL_ID.to_string())
|
||||
.get("tokenizer.json")
|
||||
.await
|
||||
.expect("fetch tokenizer.json from hf-hub")
|
||||
})
|
||||
}
|
||||
|
||||
fn bench_encode(c: &mut Criterion) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use criterion::{Criterion, Throughput, black_box, criterion_group, criterion_main};
|
||||
use hf_hub::api::sync::ApiBuilder;
|
||||
use hf_hub::api::tokio::ApiBuilder;
|
||||
use tokio::runtime::Runtime;
|
||||
use vllm_tokenizer::{TiktokenTokenizer, Tokenizer};
|
||||
|
||||
const MODEL_ID: &str = "moonshotai/Kimi-K2.5";
|
||||
@@ -52,15 +53,18 @@ impl BenchFixture {
|
||||
}
|
||||
|
||||
fn tiktoken_model() -> std::path::PathBuf {
|
||||
let repo = ApiBuilder::from_env()
|
||||
.with_progress(false)
|
||||
.build()
|
||||
.expect("build hf-hub api")
|
||||
.model(MODEL_ID.to_string());
|
||||
repo.get("config.json").expect("fetch config.json from hf-hub");
|
||||
repo.get("tokenizer_config.json")
|
||||
.expect("fetch tokenizer_config.json from hf-hub");
|
||||
repo.get("tiktoken.model").expect("fetch tiktoken.model from hf-hub")
|
||||
Runtime::new().expect("build tokio runtime").block_on(async {
|
||||
let repo = ApiBuilder::from_env()
|
||||
.with_progress(false)
|
||||
.build()
|
||||
.expect("build hf-hub api")
|
||||
.model(MODEL_ID.to_string());
|
||||
repo.get("config.json").await.expect("fetch config.json from hf-hub");
|
||||
repo.get("tokenizer_config.json")
|
||||
.await
|
||||
.expect("fetch tokenizer_config.json from hf-hub");
|
||||
repo.get("tiktoken.model").await.expect("fetch tiktoken.model from hf-hub")
|
||||
})
|
||||
}
|
||||
|
||||
fn bench_encode(c: &mut Criterion) {
|
||||
|
||||
Reference in New Issue
Block a user