File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,23 +36,16 @@ impl Embedder {
3636
3737 // Download model if missing.
3838 if !model_path. exists ( ) {
39- let expected_sha: Option < & str > = if MODEL_SHA256 . is_empty ( ) {
40- None
41- } else {
42- Some ( MODEL_SHA256 )
43- } ;
44- download_file ( MODEL_URL , & model_path, expected_sha) ?;
39+ download_file ( MODEL_URL , & model_path, Some ( MODEL_SHA256 ) ) ?;
4540 }
4641
4742 // Download tokenizer if missing.
4843 if !tokenizer_path. exists ( ) {
4944 download_file ( TOKENIZER_URL , & tokenizer_path, None ) ?;
5045 }
5146
52- // Verify model hash if we have one.
53- if !MODEL_SHA256 . is_empty ( ) {
54- verify_sha256 ( & model_path, MODEL_SHA256 ) ?;
55- }
47+ // Verify model hash.
48+ verify_sha256 ( & model_path, MODEL_SHA256 ) ?;
5649
5750 let session = Session :: builder ( )
5851 . with_context ( || "creating ONNX session builder" ) ?
Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ use anyhow::Result;
77use clap:: { Parser , Subcommand } ;
88use std:: io:: { self , BufRead , Write } ;
99use std:: path:: PathBuf ;
10- use tracing:: info;
1110
1211use config:: Config ;
1312
@@ -89,18 +88,23 @@ fn remove_dir_if_exists(path: &std::path::Path) -> Result<bool> {
8988fn main ( ) -> Result < ( ) > {
9089 let cli = Cli :: parse ( ) ;
9190
92- // Set up tracing.
93- let filter = if cli. verbose { "debug" } else { "info" } ;
91+ // Set up tracing. Default: suppress all logs (ort and hnsw_rs are very noisy).
92+ // --verbose enables debug for engraph, info for everything else.
93+ let filter = if cli. verbose {
94+ "engraph=debug,info"
95+ } else {
96+ "error"
97+ } ;
9498 tracing_subscriber:: fmt ( )
9599 . with_env_filter (
96100 tracing_subscriber:: EnvFilter :: try_from_default_env ( )
97101 . unwrap_or_else ( |_| tracing_subscriber:: EnvFilter :: new ( filter) ) ,
98102 )
103+ . with_writer ( std:: io:: stderr)
99104 . init ( ) ;
100105
101106 let mut cfg = Config :: load ( ) ?;
102107 let data_dir = Config :: data_dir ( ) ?;
103- info ! ( data_dir = %data_dir. display( ) , "loaded config" ) ;
104108
105109 match cli. command {
106110 Command :: Index { path, rebuild } => {
You can’t perform that action at this time.
0 commit comments