Skip to content

Commit f384450

Browse files
feat: hide hf_api_token from debug
1 parent 82fd2b1 commit f384450

File tree

4 files changed

+30
-4
lines changed

4 files changed

+30
-4
lines changed

Cargo.lock

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backends/candle/src/compute_cap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,4 @@ mod tests {
7373
assert!(!compute_cap_matching(90, 86));
7474
assert!(!compute_cap_matching(90, 89));
7575
}
76-
}
76+
}

router/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ tracing-opentelemetry = "0.21.0"
4444
tracing-subscriber = { version = "0.3.16", features = ["json", "env-filter"] }
4545
utoipa = { version = "4.0.0", features = ["axum_extras"] }
4646
utoipa-swagger-ui = { version = "4.0.0", features = ["axum"] }
47+
veil = "0.1.6"
4748

4849
[build-dependencies]
4950
vergen = { version = "8.0.0", features = ["build", "git", "gitcl"] }
@@ -56,4 +57,4 @@ python = ["text-embeddings-backend/python"]
5657
candle = ["text-embeddings-backend/candle"]
5758
candle-cuda = ["candle", "text-embeddings-backend/flash-attn"]
5859
candle-cuda-turing = ["candle", "text-embeddings-backend/flash-attn-v1"]
59-
static-linking = ["text-embeddings-backend/static-linking"]
60+
static-linking = ["text-embeddings-backend/static-linking"]

router/src/main.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ use tower_http::cors::AllowOrigin;
2424
use tracing_subscriber::layer::SubscriberExt;
2525
use tracing_subscriber::util::SubscriberInitExt;
2626
use tracing_subscriber::{EnvFilter, Layer};
27+
use veil::Redact;
2728

2829
/// App Configuration
29-
#[derive(Parser, Debug)]
30+
#[derive(Parser, Redact)]
3031
#[clap(author, version, about, long_about = None)]
3132
struct Args {
3233
/// The name of the model to load.
@@ -35,6 +36,7 @@ struct Args {
3536
/// Or it can be a local directory containing the necessary files
3637
/// as saved by `save_pretrained(...)` methods of transformers
3738
#[clap(default_value = "thenlper/gte-base", long, env)]
39+
#[redact(partial)]
3840
model_id: String,
3941

4042
/// The actual revision of the model if you're referring to a model
@@ -91,6 +93,7 @@ struct Args {
9193

9294
/// Your HuggingFace hub token
9395
#[clap(long, env)]
96+
#[redact(partial)]
9497
hf_api_token: Option<String>,
9598

9699
/// The IP address to listen on
@@ -212,7 +215,7 @@ async fn main() -> Result<()> {
212215
tokenizer.with_padding(None);
213216

214217
// Position IDs offset. Used for Roberta.
215-
let position_offset = if &config.model_type == "xlm-roberta" {
218+
let position_offset = if &config.model_type == "xlm-roberta" {
216219
config.pad_token_id + 1
217220
} else {
218221
0

0 commit comments

Comments
 (0)