Spaces:
Sleeping
Sleeping
Commit History
-
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
-
feat: Implement V3 Web Scraping + Summarization API
ming✨ New Features: - Add V3 API endpoint: POST /api/v3/scrape-and-summarize/stream - Backend web scraping with trafilatura (95%+ success rate) - In-memory TTL-based caching (1 hour default, configurable) - User-agent rotation to avoid anti-scraping measures - Metadata extraction (title, author, date, site_name) - SSRF protection (blocks localhost and private IPs) - Streaming SSE response with metadata + content chunks 📦 New Components: - ArticleScraperService: High-quality article extraction - SimpleCache: In-memory cache with TTL and max size - V3 Router: Complete API implementation with validation - V3 Schemas: Request/response models with security validators 🧪 Testing: - 30 new tests (100% passing) - Cache tests: TTL, expiration, thread safety - Scraper tests: Success, timeouts, validation - API tests: Security (SSRF), error handling, streaming format 📝 Documentation: - Updated CLAUDE.md with V3 details - Updated README.md with V3 usage examples - Added V3_SCRAPING_IMPLEMENTATION…2ed2bd7
-
Update v2 API and HF streaming summarizer improvements
mingfc9914e -
Improve V2 summarization: adaptive tokens, recursive summarization, better defaults
ming- Add temperature and top_p parameters to SummarizeRequest schema (defaults: 0.3, 0.9) - Implement adaptive max_new_tokens logic: 60-100 for short texts, proportional for long texts - Add recursive summarization for texts >1500 chars with chunking and summary-of-summaries - Fix generation parameters to prevent rambling (reduce min_new_tokens, neutral length_penalty) - Update default prompt to be more concise - Add comprehensive unit tests for all improvements (40 tests) - Fix V2 API to generate concise summaries instead of rambling output9884884
-
Improve V2 summarization prompts for more detailed output
ming- Updated default prompt in HF streaming service to request comprehensive summaries - Enhanced prompt asks for main arguments, key findings, important details, and examples - Applied consistent improved prompts across V1 and V2 API endpoints - Optimized for sshleifer/distilbart-cnn-6-6 model to produce more detailed summariesde8b12b -
Add V2 API with HuggingFace streaming support
ming- Add V2 API endpoints with HuggingFace TextIteratorStreamer - Implement real-time token-by-token streaming via SSE - Add configurable HuggingFace model support (default: Phi-3-mini-4k-instruct) - Maintain V1 API compatibility - Android app only needs to change /api/v1/ to /api/v2/ - Add conditional warmup (V1 disabled, V2 enabled by default) - Add comprehensive tests for V2 API and HF streaming service - Update README with V2 documentation and Android client examples - Add accelerate package for better device mapping - All 116 tests pass (97 original + 19 new V2 tests)0b6e76d