Switch to burn 0.9.0 to gain fast model io without the need for a custom recorder
This commit is contained in:
@@ -22,8 +22,7 @@ cfg_if::cfg_if! {
|
||||
}
|
||||
}
|
||||
|
||||
use burn::record::{self, Recorder, FullPrecisionSettings};
|
||||
use stablediffusion::binrecorderfast::{BinFileRecorderBuffered};
|
||||
use burn::record::{self, Recorder, BinFileRecorder, FullPrecisionSettings};
|
||||
|
||||
fn convert_dump_to_model<B: Backend>(dump_path: &str, model_name: &str, device: &B::Device) -> Result<(), Box<dyn Error>> {
|
||||
println!("Loading dump...");
|
||||
@@ -36,7 +35,7 @@ fn convert_dump_to_model<B: Backend>(dump_path: &str, model_name: &str, device:
|
||||
}
|
||||
|
||||
fn save_model_file<B: Backend>(model: StableDiffusion<B>, name: &str) -> Result<(), record::RecorderError> {
|
||||
BinFileRecorderBuffered::<FullPrecisionSettings>::new()
|
||||
BinFileRecorder::<FullPrecisionSettings>::new()
|
||||
.record(
|
||||
model.into_record(),
|
||||
name.into(),
|
||||
|
||||
@@ -22,11 +22,10 @@ use std::env;
|
||||
use std::io;
|
||||
use std::process;
|
||||
|
||||
use burn::record::{self, Recorder, FullPrecisionSettings};
|
||||
use stablediffusion::binrecorderfast::{BinFileRecorderBuffered};
|
||||
use burn::record::{self, Recorder, BinFileRecorder, FullPrecisionSettings};
|
||||
|
||||
fn load_stable_diffusion_model_file<B: Backend>(filename: &str) -> Result<StableDiffusion<B>, record::RecorderError> {
|
||||
BinFileRecorderBuffered::<FullPrecisionSettings>::new()
|
||||
BinFileRecorder::<FullPrecisionSettings>::new()
|
||||
.load(filename.into())
|
||||
.map(|record| StableDiffusionConfig::new().init().load_record(record))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user