Module export

Module export 

Source
Expand description

SONA Export Module - HuggingFace Integration

Export learned patterns, LoRA weights, and trajectories to HuggingFace-compatible formats for pretraining, fine-tuning, and knowledge distillation.

§Supported Export Formats

  • SafeTensors: LoRA adapter weights in PEFT-compatible format
  • JSONL Dataset: ReasoningBank patterns as HuggingFace datasets
  • Preference Pairs: Quality trajectories for DPO/RLHF training
  • Distillation Targets: Routing decisions for knowledge distillation

§Example

use ruvector_sona::export::{HuggingFaceExporter, ExportConfig};

let exporter = HuggingFaceExporter::new(&engine);

// Export LoRA weights
exporter.export_lora_safetensors("./lora_weights")?;

// Export patterns as dataset
exporter.export_patterns_jsonl("./patterns.jsonl")?;

// Export preference pairs for RLHF
exporter.export_preference_pairs("./preferences.jsonl")?;

Re-exports§

pub use safetensors::SafeTensorsExporter;
pub use dataset::DatasetExporter;
pub use huggingface_hub::HuggingFaceHub;
pub use pretrain::PretrainConfig;
pub use pretrain::PretrainPipeline;

Modules§

dataset
Dataset Export - HuggingFace-compatible dataset formats
huggingface_hub
HuggingFace Hub Integration
pretrain
Pretraining Pipeline - SONA-optimized model pretraining configuration
safetensors
SafeTensors Export - PEFT-compatible LoRA weight serialization

Structs§

AdapterConfig
PEFT-compatible adapter configuration
ExportConfig
Export configuration
ExportResult
Export result
HuggingFaceExporter
Main HuggingFace exporter

Enums§

ExportError
Export errors
ExportType
Export type enum