- Added `CODE_OF_CONDUCT.md` to establish community standards for behavior and inclusivity. - Added `CONTRIBUTING.md` with detailed guidelines for contributing to the `brainy-models-package`: - Model quality, testing, and optimization requirements. - Development setup instructions, including build and test scripts. - Pull request and commit message conventions. - Package-specific utility scripts and file structure overview. **Purpose**: Provide clear contribution and community guidelines to foster collaboration and maintain project quality standards.
3.1 KiB
Contributing to @soulcraft/brainy-models
Thank you for your interest in contributing to the Brainy Models package! This package provides pre-bundled TensorFlow models for the Brainy vector database.
Overview
The @soulcraft/brainy-models package is part of the larger Brainy ecosystem. For general contribution guidelines, please refer to the main Brainy Contributing Guide.
Package-Specific Guidelines
Model Contributions
When contributing to the models package, please consider:
- Model Quality: Ensure models are properly tested and validated
- Model Size: Be mindful of package size impact (current package is ~25MB)
- Compatibility: Ensure models work with the target TensorFlow.js versions
- Documentation: Update README.md with new model information
Development Setup
- Fork and clone the main repository
- Navigate to the models package:
cd brainy-models-package - Install dependencies:
npm install - Download models:
npm run download-models - Build the package:
npm run build - Run tests:
npm test
Testing Models
Before submitting changes:
# Test model functionality
npm test
# Test model compression
npm run compress-models
# Verify package integrity
npm run pack
Model Scripts
The package includes several utility scripts:
download-models- Download the Universal Sentence Encoder modelcompress-models- Create optimized model variantstest- Verify model functionality
Commit Guidelines
Follow the same commit message conventions as the main Brainy project:
- Use conventional commit format
- Keep first line under 50 characters
- Use imperative mood ("Add model" not "Added model")
- Reference issues where appropriate
Pull Request Process
- Ensure your changes don't break existing functionality
- Update documentation if you're adding new models or features
- Test model loading and embedding generation
- Verify package size impact is acceptable
- Submit PR to the main Brainy repository
Model Optimization
When working with models:
- Float16: For balanced performance and size
- Int8: For memory-constrained environments
- Original: For maximum accuracy
File Structure
brainy-models-package/
├── models/ # Model files
├── src/ # TypeScript source
├── dist/ # Compiled output
├── scripts/ # Utility scripts
└── test/ # Test files
Code of Conduct
This project follows the same Code of Conduct as the main Brainy project.
Questions and Support
For questions specific to the models package:
- GitHub Issues - Use the
brainy-modelslabel - Main Documentation
For general Brainy questions, refer to the main repository.
License
By contributing to this project, you agree that your contributions will be licensed under the MIT License.