Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,4 +281,49 @@ All notable changes to this project will be documented in this file.

---

## [Unreleased] - 2025-08-07

Copilot AI Aug 10, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The date '2025-08-07' in the Unreleased section is inconsistent with changelog conventions. Unreleased sections typically don't include specific dates since they represent pending changes. Consider using just '## [Unreleased]' or move this to a versioned release when ready.

Suggested change
## [Unreleased] - 2025-08-07
## [Unreleased]

Copilot uses AI. Check for mistakes.

### Added
- **Custom Model Deployment Solution** - Complete pipeline to upload custom-trained models to HuggingFace Hub for production deployment
- Created `scripts/deployment/upload_model_to_huggingface.py` - Comprehensive script to find, prepare, and upload custom trained models
- Added `deployment/CUSTOM_MODEL_DEPLOYMENT_GUIDE.md` - Complete guide for deploying custom models with multiple deployment strategies
- Added `deployment/flexible_api_server.py` - Flexible API server supporting serverless, endpoints, and self-hosted deployments
Comment on lines +288 to +290

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This changelog entry appears to document a set of features and files that are not included in this pull request or the current branch. The following files mentioned in the Added section are missing:

  • scripts/deployment/upload_model_to_huggingface.py
  • deployment/CUSTOM_MODEL_DEPLOYMENT_GUIDE.md
  • deployment/flexible_api_server.py

This discrepancy makes the changelog inaccurate and could cause significant confusion for anyone reading the release notes. Please ensure the changelog accurately reflects the changes being introduced in the codebase.

- **Portable Configuration**: Environment variable support (`SAMO_DL_BASE_DIR` or `MODEL_BASE_DIR`) with automatic project root detection
- Added `deployment/models/` directory with README for organized model storage
- Created `.env.model_config.example` template for easy environment configuration
- **HuggingFace Deployment Strategies**:
- 🆓 Serverless Inference API (free tier with rate limits)

Copilot AI Aug 10, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Using emoji characters in changelog entries may cause display issues in certain environments or when the changelog is processed by automated tools. Consider using plain text alternatives like '[FREE]' or '(Free)' instead of '🆓'.

Suggested change
- 🆓 Serverless Inference API (free tier with rate limits)
- [FREE] Serverless Inference API (free tier with rate limits)

Copilot uses AI. Check for mistakes.
- 🚀 Inference Endpoints (paid, production-grade with consistent latency)

Copilot AI Aug 10, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Using emoji characters in changelog entries may cause display issues in certain environments or when the changelog is processed by automated tools. Consider using plain text alternatives like '[PAID]' or '(Production)' instead of '🚀'.

Suggested change
- 🚀 Inference Endpoints (paid, production-grade with consistent latency)
- [PAID] Inference Endpoints (paid, production-grade with consistent latency)

Copilot uses AI. Check for mistakes.
- 🏠 Self-hosted (maximum control with local transformers)

Copilot AI Aug 10, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Using emoji characters in changelog entries may cause display issues in certain environments or when the changelog is processed by automated tools. Consider using plain text alternatives like '[SELF-HOSTED]' or '(Local)' instead of '🏠'.

Suggested change
- 🏠 Self-hosted (maximum control with local transformers)
- [SELF-HOSTED] Self-hosted (maximum control with local transformers)

Copilot uses AI. Check for mistakes.
- **Automated Features**:
- Model format conversion (PyTorch .pth to HuggingFace format)
- Git LFS setup for large model files
- Environment configuration templates (.env.serverless, .env.endpoints, .env.selfhosted)
- Deployment configuration updates
- Model card generation with proper metadata and usage examples
- Cold start handling and retry logic for API calls

### Fixed
- **Model-as-a-Service Configuration Issue** - Resolved deployment using untrained base models instead of custom trained models
- Deployment was falling back to base `distilroberta-base` and `bert-base-uncased` models
- Custom models trained in Colab were not accessible to deployment infrastructure
- Now properly uploads custom models to HuggingFace Hub for production access

### Changed
- Deployment infrastructure now supports custom models from HuggingFace Hub instead of local files only
- Updated model loading configuration to use custom emotion labels (12 classes) instead of generic ones

### Technical Details
- **Model Architecture**: DistilRoBERTa/BERT fine-tuned on custom journal entries
- **Emotion Classes**: 12 specialized emotions (anxious, calm, content, excited, frustrated, grateful, happy, hopeful, overwhelmed, proud, sad, tired)
- **Performance**: Expected ~85% accuracy vs ~60% with base models
- **Deployment Options**:
- Serverless API: Free tier, 30s timeout, automatic retry and cold start handling
- Inference Endpoints: Paid service, 10s timeout, no cold starts, consistent latency
- Self-hosted: Local transformers, full control, configurable device (CPU/GPU)
- **Storage**: Uses HuggingFace Hub as model repository with Git LFS for large files
- **Cost Structure**: Public repos free, private repos with quotas, bandwidth tracking
Comment on lines +287 to +325

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While the detail provided in this changelog entry is comprehensive, it might be overly verbose for a high-level changelog, especially the 'Automated Features' and 'Technical Details' sections. Consider summarizing the key features and linking to the new CUSTOM_MODEL_DEPLOYMENT_GUIDE.md or other technical documentation for the full details. This would make the main changelog more scannable for users.

A more concise entry might look like:

### Added
- **Custom Model Deployment Solution**: Added a complete pipeline to upload and deploy custom-trained models to HuggingFace Hub. This includes scripts for uploading, a flexible API server, and comprehensive documentation. See `deployment/CUSTOM_MODEL_DEPLOYMENT_GUIDE.md` for full details on deployment strategies (Serverless, Endpoints, Self-hosted) and automated features.

### Fixed
- **Model-as-a-Service Configuration Issue**: Resolved an issue where deployments incorrectly used untrained base models instead of custom-trained ones.

### Changed
- The deployment infrastructure now supports custom models from HuggingFace Hub.
- Model loading configuration updated to use 12 custom emotion classes.

The 'Technical Details' section could be moved to the relevant guide or design document.


---

*This changelog follows the [Keep a Changelog](https://keepachangelog.com/) format and adheres to [Semantic Versioning](https://semver.org/).*