Spaces:
Sleeping
Sleeping
Commit History
-
fix: run ensemble models sequentially on CPU for better performance
aviseth- Detect CPU vs GPU environment - Run models sequentially on CPU (avoids resource contention) - Run models in parallel on GPU (faster) - Increase total timeout to 180s for CPU sequential execution - Update error message with helpful suggestion - Fixes timeout issues on HuggingFace Spaces5684fb0
-
perf: optimize ensemble for CPU inference on HuggingFace Spaces
aviseth- Increase timeouts: 45s per model, 60s total (from 20s/30s) - Reduce max_length from 256 to 128 tokens for faster inference - Truncate input text to 2000 chars to reduce processing time - Use torch.inference_mode() instead of no_grad() for better performance - Update timeout error message to explain CPU limitations93a6c45
-
feat: improve ensemble voting with confidence weighting and per-class F1 scores
aviseth- Keep all 3 voting strategies display (hard/soft/weighted) - Soft voting now weights by model confidence (more confident models count more) - Weighted voting uses per-class F1 scores instead of overall accuracy - Add uncertainty metric (1 - max confidence) - Add model_agreement metric (% of models that agree) - Token merging weighted by class-specific F1 scores - Update all tests to include new metrics4cc1ba8 -
revert: restore 3 voting strategies display
avisethUser prefers seeing all 3 voting strategies (hard/soft/weighted) in the responsea6355a1 -
refactor: simplify ensemble voting to single smart strategy
aviseth- Replace 3 voting methods (hard/soft/weighted) with 1 smart_voting method - Use confidence-weighted predictions with per-class F1 scores - Add uncertainty and model_agreement metrics to results - Weight token explanations by class-specific F1 scores - Simplify API response structure (remove voting_strategies) - Update all tests to match new simplified structure - Minimalist approach for better user experiencec0e80a3 -
fix: suppress beta/gamma warnings globally and increase ensemble timeouts for CPU
aviseth- Move warning filters to module level (before imports) to catch all warnings - Increase per-model timeout from 10s to 20s for HF Spaces CPU - Increase total ensemble timeout from 15s to 30s - Prevents timeout failures on CPU-only inferencebb4a756 -
fix: resolve 6 critical ensemble and API issues
aviseth1. Remove redundant outer timeout on /predict/ensemble endpoint - ensemble.predict_ensemble() already has internal 15s timeout - Outer asyncio.wait_for was canceling coroutine mid-flight - Now allows graceful partial-result handling when models fail 2. Enforce per-model timeout in _predict_with_timeout - Was accepting timeout parameter but never using it - Now uses concurrent.futures.Future.result(timeout=X) - Prevents single slow model from blocking indefinitely 3. Fix hard_voting tie-breaking to be deterministic - When 3-way tie (all models predict different labels) - Now breaks tie by highest average confidence - Previously relied on dict iteration order (non-deterministic) 4. Fix primary_prediction.scores to show full distribution - Was only returning {winning_label: confidence} - Now returns full soft_voting_scores (all 4 classes) - Frontend can now display complete probability breakdown 5. Replace deprecated asyncio.get_event_loop() with ge…cb5302e
-
feat: Phase 1 enhancements - ensemble endpoint, history API, rate limiting, storage monitoring
aviseth1a5863d