feat: update workspace paths and enhance gitignore
- Updated stablediffusion crate path from "../stable-diffusion-burn" to "./crates/stable-diffusion-burn" for proper workspace resolution - Enhanced .gitignore to include generated model files (.mpk, .pt, .bin, .safetensors, .ckpt) and user_data directory - Added Cargo.lock to gitignore with appropriate comment - Reorganized IDE files section in gitignore for better clarity - Added newline at end of file for proper formatting
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
use burn_dataset::HuggingfaceDatasetLoader;
|
||||
use burn_dataset::SqliteDataset;
|
||||
use serde::Deserialize;
|
||||
|
||||
#[derive(Deserialize, Debug, Clone)]
|
||||
struct MnistItemRaw {
|
||||
pub _image_bytes: Vec<u8>,
|
||||
pub _label: usize,
|
||||
}
|
||||
fn main() {
|
||||
// There are some datasets, such as https://huggingface.co/datasets/ylecun/mnist/tree/main that contains a script,
|
||||
// In this cases you must enable trusting remote code execution if you want to use it.
|
||||
let _train_ds: SqliteDataset<MnistItemRaw> = HuggingfaceDatasetLoader::new("mnist")
|
||||
.with_trust_remote_code(true)
|
||||
.dataset("train")
|
||||
.unwrap();
|
||||
|
||||
// However not all dataset requires it https://huggingface.co/datasets/Anthropic/hh-rlhf/tree/main
|
||||
let _train_ds: SqliteDataset<MnistItemRaw> = HuggingfaceDatasetLoader::new("Anthropic/hh-rlhf")
|
||||
.dataset("train")
|
||||
.unwrap();
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
#[cfg(feature = "audio")]
|
||||
use burn_dataset::{Dataset, audio::SpeechCommandsDataset};
|
||||
|
||||
#[cfg(feature = "audio")]
|
||||
fn speech_command() {
|
||||
let index: usize = 4835;
|
||||
let test = SpeechCommandsDataset::test();
|
||||
let item = test.get(index).unwrap();
|
||||
|
||||
println!("Item: {:?}", item);
|
||||
println!("Item Length: {:?}", item.audio_samples.len());
|
||||
println!("Label: {}", item.label);
|
||||
|
||||
assert_eq!(test.len(), 4890);
|
||||
assert_eq!(item.label.to_string(), "Yes");
|
||||
assert_eq!(item.sample_rate, 16000);
|
||||
assert_eq!(item.audio_samples.len(), 16000);
|
||||
}
|
||||
|
||||
fn main() {
|
||||
#[cfg(feature = "audio")]
|
||||
speech_command()
|
||||
}
|
||||
Reference in New Issue
Block a user