Fix clippy.
This commit is contained in:
Nicolas Patry 2024-06-25 17:53:36 +02:00 committed by GitHub
parent fc9c3153e5
commit a2a97b05d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 8 additions and 5 deletions

View File

@ -147,7 +147,9 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
tracing::info!("Downloading tokenizer"); tracing::info!("Downloading tokenizer");
// Parse Huggingface hub token // Parse Huggingface hub token
let auth_token = std::env::var("HF_TOKEN").or_else(|_| std::env::var("HUGGING_FACE_HUB_TOKEN")).ok(); let auth_token = std::env::var("HF_TOKEN")
.or_else(|_| std::env::var("HUGGING_FACE_HUB_TOKEN"))
.ok();
// Download and instantiate tokenizer // Download and instantiate tokenizer
// We need to download it outside of the Tokio runtime // We need to download it outside of the Tokio runtime

View File

@ -762,7 +762,7 @@ fn num_cuda_devices() -> Option<usize> {
Err(_) => match env::var("NVIDIA_VISIBLE_DEVICES") { Err(_) => match env::var("NVIDIA_VISIBLE_DEVICES") {
Ok(devices) => devices, Ok(devices) => devices,
Err(_) => env::var("ZE_AFFINITY_MASK").ok()?, Err(_) => env::var("ZE_AFFINITY_MASK").ok()?,
} },
}; };
let n_devices = devices.split(',').count(); let n_devices = devices.split(',').count();
Some(n_devices) Some(n_devices)
@ -1225,7 +1225,6 @@ fn spawn_webserver(
router_args.push("--otlp-service-name".to_string()); router_args.push("--otlp-service-name".to_string());
router_args.push(otlp_service_name); router_args.push(otlp_service_name);
// CORS origins // CORS origins
for origin in args.cors_allow_origin.into_iter() { for origin in args.cors_allow_origin.into_iter() {
router_args.push("--cors-allow-origin".to_string()); router_args.push("--cors-allow-origin".to_string());

View File

@ -159,7 +159,9 @@ async fn main() -> Result<(), RouterError> {
}); });
// Parse Huggingface hub token // Parse Huggingface hub token
let authorization_token = std::env::var("HF_TOKEN").or_else(|_| std::env::var("HUGGING_FACE_HUB_TOKEN")).ok(); let authorization_token = std::env::var("HF_TOKEN")
.or_else(|_| std::env::var("HUGGING_FACE_HUB_TOKEN"))
.ok();
// Tokenizer instance // Tokenizer instance
// This will only be used to validate payloads // This will only be used to validate payloads