Skip to main content

Crate akuna_infer

Crate akuna_infer 

Source
Expand description

File-type detection using Magika and Burn.

§Example

use akuna_infer::Session;
use burn_wgpu::{Wgpu, WgpuDevice};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let device = WgpuDevice::default();
    let mut session = Session::<Wgpu>::new(&device)?;

    let detected = session.identify_content_sync(b"fn main() { println!(\"hi\"); }")?;
    println!("{} {}", detected.info().label, detected.info().mime_type);

    Ok(())
}

Structs§

Detection
InferredType
Content type identified using AI.
MagikaModel
ModelConfig
RankedAlternative
Session
TypeInfo
File type information.

Enums§

ContentType
Content types for regular files.
Error
FileType
File types.
MagikaInferenceError
OverwriteReason
Reason to overwrite an inferred content type.

Constants§

MODEL_MAJOR_VERSION
Model major version.
MODEL_NAME
Model name (only comparable with equality).

Functions§

preprocess_bytes
Legacy helper kept for callers that still want a normalized head/tail feature vector.