3 releases
new 0.1.2 | Feb 19, 2025 |
---|---|
0.1.1 | Feb 16, 2025 |
0.1.0 | Feb 15, 2025 |
#145 in Filesystem
193 downloads per month
9KB
112 lines
extract-metadata
A command-line utility for batch extracting metadata from safetensors files. This tool can process individual files or recursively scan directories to extract metadata from all safetensors files.
Features
- Process single safetensors files or entire directories
- Support for glob patterns to match multiple files
- Recursive directory scanning
- Asynchronous processing for better performance
- Detailed metadata extraction from safetensors files
Installation
Ensure you have Rust installed on your system, then you can install using cargo:
cargo install extract-metadata
Or build from source:
git clone https://github.com/rakki194/extract-metadata
cd extract-metadata
cargo build --release
Usage
The tool supports several usage patterns:
-
Process a single file:
extract-metadata path/to/model.safetensors
-
Process all safetensors files in a directory (recursive):
extract-metadata path/to/directory
-
Use glob patterns to match specific files:
extract-metadata "models/*.safetensors"
Dependencies
- tokio - Async runtime
- anyhow - Error handling
- glob - File pattern matching
- env_logger - Logging functionality
- dset - Internal safetensors processing
- xio - File system operations
Error Handling
The tool includes robust error handling and will:
- Skip invalid files while continuing to process others
- Provide clear error messages for invalid paths or patterns
- Handle IO errors gracefully
License
MIT License
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Dependencies
~7–16MB
~203K SLoC