From 7fb174bf17a363522acf0a71c22abe623096dbd1 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Tue, 15 Oct 2024 05:52:42 +0000 Subject: [PATCH] feat: add log for MODEL_INTERNET env --- Dockerfile.r4userembedding | 2 +- Dockerfile.r4userembeddingwithmodel | 2 +- user-embedding/src/bertcommon.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile.r4userembedding b/Dockerfile.r4userembedding index 2170d15..d1c66d1 100644 --- a/Dockerfile.r4userembedding +++ b/Dockerfile.r4userembedding @@ -22,7 +22,7 @@ RUN cargo build --release FROM ubuntu:jammy # Import from builder. -ENV MODEL_INTERNET = "true" +ENV MODEL_INTERNET="true" WORKDIR /userembedding diff --git a/Dockerfile.r4userembeddingwithmodel b/Dockerfile.r4userembeddingwithmodel index c74a648..9d698ef 100644 --- a/Dockerfile.r4userembeddingwithmodel +++ b/Dockerfile.r4userembeddingwithmodel @@ -23,7 +23,7 @@ RUN /userembedding/target/release/downloadmodel FROM ubuntu:jammy # Import from builder. -ENV MODEL_INTERNET = "false" +ENV MODEL_INTERNET="false" WORKDIR /userembedding diff --git a/user-embedding/src/bertcommon.rs b/user-embedding/src/bertcommon.rs index 595f572..951689e 100644 --- a/user-embedding/src/bertcommon.rs +++ b/user-embedding/src/bertcommon.rs @@ -95,10 +95,10 @@ async fn calculate_userembedding() -> AnyhowResult { let mut cumulative_tensor: Tensor = option_cumulative_tensor.unwrap(); let default_model: String = model_related_info.hugging_face_model_name.to_string(); let default_revision: String = model_related_info.hugging_face_model_revision.to_string(); - let MODEL_INTERNET: String = env::var("MY_ENV_VAR").unwrap_or("false".to_string()); + let MODEL_INTERNET: String = env::var("MODEL_INTERNET").unwrap_or("false".to_string()); let mut model_option: Option = None; let mut model_tokenizer: Option = None; - + log::info!("MODEL_INTERNET {}", MODEL_INTERNET); if MODEL_INTERNET == "true" { logdebug!("use internet model"); let (model, mut tokenizer, _) = embedding_common::build_model_and_tokenizer_from_internet(