Spaces:
Sleeping
Sleeping
Commit History
-
Remove outlines library and all related code
ming- Remove outlines dependency from requirements.txt (NumPy compatibility issue) - Remove outlines import validation from Dockerfile - Remove /stream-json endpoint from V4 API (outlines-based) - Remove all outlines-related code from structured_summarizer.py - Remove outlines import tests - Delete test_v4_live.py (outlines integration tests) - Remove all stream-json endpoint tests from test_v4_api.py This resolves the Hugging Face build failure caused by outlines==0.0.44 incompatibility with newer NumPy versions (ModuleNotFoundError: numpy.lib.function_base). V4 API now only supports /stream and /stream-ndjson endpoints using NDJSON patch-based structured summarization (no external dependencies).d25a17f -
Migrate to Ruff for linting/formatting and add comprehensive import tests
ming- Replace black, isort, and flake8 with ruff (Rust-based, 10-100x faster) - Add ruff.toml configuration with appropriate rules and ignores - Update pre-commit hook to run ruff check --fix and ruff format before tests - Update CLAUDE.md documentation with new ruff commands - Fix code style issues (nested if statements, formatting) - Add comprehensive import tests (test_imports.py) to catch import errors early - Fix config.py to ignore extra environment variables (prevents build failures) - Format all code with ruff (18 files reformatted) - Auto-fix 32 linting issues - Fix remaining test linting issues (B017, SIM117, B023) Benefits: - Single tool instead of three (black/isort/flake8) - Faster pre-commit hooks - Better CI/CD performance - Automatic import validation before deployment29ed661
-
Add Outlines JSON streaming endpoint for V4 structured summarization
ming- Add outlines>=0.0.34 dependency - Add StructuredSummary Pydantic schema - Wrap Qwen model with Outlines Transformers wrapper - Implement summarize_structured_stream_json() method - Add /api/v4/scrape-and-summarize/stream-json endpoint - Stream JSON tokens token-by-token via SSE - Add Outlines warmup in warm_up_model() - Graceful degradation when Outlines not available441f66b
-
feat: Add V4 NDJSON patch-based structured summarization
ming- Refactor StructuredSummarizer with new NDJSON streaming protocol - Add summarize_structured_stream_ndjson() method for patch-based streaming - Implement state management with _empty_state() and _apply_patch() - Update system prompt to instruct model to output NDJSON patches - Add new /api/v4/scrape-and-summarize/stream-ndjson endpoint - Support incremental state updates via delta/state events - Use deterministic decoding (greedy) for consistent results - Maintain backwards compatibility with existing stream endpoint Event structure: - delta: JSON patch object (set/append/done operations) - state: Current accumulated state - done: Completion flag - tokens_used: Token count - latency_ms: Final latency metric Test suite: - test_v4_ndjson_mock.py: Protocol logic validation (PASSED ✅) - test_v4_ndjson_http.py: HTTP endpoint test - test_v4_ndjson_url.py: URL scraping test (PASSED ✅) - test_v4_ndjson.py: Direct service test Documentation: - NDJSON_REFACTOR_SUMMARY.md:…93c9664