Skip to content

Commit

Permalink
added warning for training in debug build
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexErrant committed Feb 21, 2024
1 parent ec256ae commit bccb12f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use fsrs::{
anki_to_fsrs, to_revlog_entry, FSRSItem, FSRSReview, MemoryState, NextStates, DEFAULT_WEIGHTS,
FSRS,
};
use log::info;
use log::{info, warn};
use wasm_bindgen::prelude::*;

#[wasm_bindgen(js_name = Fsrs)]
Expand Down Expand Up @@ -54,6 +54,8 @@ impl FSRSwasm {
}

fn train_and_set_weights(&mut self, items: Vec<FSRSItem>) -> Vec<f32> {
#[cfg(debug_assertions)]
warn!("You're training with a debug build... this is going to take a *long* time.");
let weights = self.model.compute_weights(items, false, None).unwrap();
self.model = FSRS::new(Some(&weights)).unwrap();
weights
Expand Down

0 comments on commit bccb12f

Please sign in to comment.