Skip to content

Commit

Permalink
fix compile warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Endle committed Sep 22, 2024
1 parent 4e06273 commit a7ce1a9
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 16 deletions.
4 changes: 2 additions & 2 deletions fire_seq_search_server/src/http_client/endpoints.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use std::sync::Arc;
use log::{debug, info};
use log::{debug};

use crate::query_engine::{QueryEngine, ServerInformation};
use axum::Json;
use axum::extract::State;
use axum::{response::Html, routing::get, Router, extract::Path};
use axum::{response::Html, extract::Path};

pub async fn get_server_info(State(engine_arc): State<Arc<QueryEngine>>)
-> Json<ServerInformation> {
Expand Down
5 changes: 3 additions & 2 deletions fire_seq_search_server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub mod word_frequency;
pub mod local_llm;


use log::{debug, info};
use log::debug;
use crate::query_engine::ServerInformation;
use crate::query_engine::NotebookSoftware::Logseq;

Expand All @@ -20,6 +20,7 @@ pub static JOURNAL_PREFIX: &str = "@journal@";


pub struct Article {
#[allow(dead_code)] /* TODO rethink if we need it 2024 Sep 21 */
file_name: String,
content: String
}
Expand Down Expand Up @@ -73,7 +74,6 @@ tanvity's default tokenizer will lowercase all English characters.
However, I think there could be a better approach
1. use https://github.com/pemistahl/lingua-rs to determine the language of the text
2. Select proper tokenizer
*/
fn process_token_text(text: &str, indices: &Vec<(usize, char)>, token: &jieba_rs::Token<'_>) -> Option<String> {
let raw = String::from(&text[(indices[token.start].0)..(indices[token.end].0)]);
let lower = raw.to_lowercase();
Expand All @@ -83,6 +83,7 @@ fn process_token_text(text: &str, indices: &Vec<(usize, char)>, token: &jieba_rs
Some(lower)
}
}
*/

// TODO use stub now
pub fn tokenize_default(sentence: &str) -> Vec<String> {
Expand Down
5 changes: 1 addition & 4 deletions fire_seq_search_server/src/load_notes/mod.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
use std::fs::DirEntry;
use log::{debug, error, info, warn};
use log::{debug, error, info};
use std::process;

use rayon::prelude::*;
use crate::query_engine::ServerInformation;
use crate::JOURNAL_PREFIX;


use std::borrow::Cow;
Expand Down
7 changes: 3 additions & 4 deletions fire_seq_search_server/src/local_llm/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use log::{info, error};
use crate::query_engine::ServerInformation;
use crate::query_engine::DocData;

use std::collections::HashMap;
Expand Down Expand Up @@ -166,7 +165,7 @@ impl LlmEngine {
let client = reqwest::Client::new();

info!("llm engine initialized");
let mut map = Arc::new(Mutex::new(
let map = Arc::new(Mutex::new(
JobProcessor::new()));
Self {
endpoint,
Expand Down Expand Up @@ -230,7 +229,7 @@ impl LlmEngine{
return;
}

let mut next_job: Option<DocData> = None;
let next_job: Option<DocData>;

let mut jcache = self.job_cache.lock().await;//.unwrap();
next_job = jcache.job_queue.pop_front();
Expand Down Expand Up @@ -306,7 +305,7 @@ async fn locate_llamafile() -> Option<String> {
lf.filepath = Some( lf_path.to_owned() );
info!("lf {:?}", &lf);

let ppath = std::path::Path::new(&lf_path);
let _ppath = std::path::Path::new(&lf_path);
//let val = sha256::try_digest(ppath).unwrap();
let val = "1903778f7defd921347b25327ebe5dd902f29417ba524144a8e4f7c32d83dee8";
if val != lf.sha256 {
Expand Down
6 changes: 2 additions & 4 deletions fire_seq_search_server/src/query_engine/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Everything about Tantivy should be hidden behind this component

use log::{debug, info, warn, error};
use crate::{Article, decode_cjk_str};
use log::{debug, info, error};
use crate::decode_cjk_str;
use crate::post_query::post_query_wrapper;
use std::sync::Arc;

Expand Down Expand Up @@ -87,8 +87,6 @@ impl QueryEngine {
note: NoteListItem,
index_writer: &IndexWriter<TantivyDocument>) {

info!(" inside future {:?}", note);

let raw_content = match std::fs::read_to_string(&note.realpath) {
Ok(s) => s,
Err(e) => {
Expand Down

0 comments on commit a7ce1a9

Please sign in to comment.