Major refactoring to improve performance and add GPU support:
- Migrate from numpy (.npy) to PyTorch tensors (.pt) for embeddings
- Add automatic GPU detection and device selection (cuda/cpu)
- Unify tensor operations - single tensor works for both CPU and GPU
- Fix argsort error in multi-topic similarity computation
- Add Docker GPU support with --gpus flag in run.sh
- Improve performance with vectorized PyTorch operations (40x speedup)
- Maintain backward compatibility with CPU-only environments
Changes:
- Add cache-dir/embeddings_all-mpnet-base-v2_norvig_100000.pt (238MB)
- Update thematic_word_service.py for unified PyTorch tensors
- Add GPU/CPU mode selection in run.sh and build.sh scripts
- Update .gitattributes to track .pt files with Git LFS
Performance improvements:
- GPU acceleration when available (GTX 1650 tested)
- Vectorized operations for multi-topic similarity
- Direct PyTorch tensor operations without numpy conversions
Signed-off-by: Vimal Kumar <vimal78@gmail.com>
fix: clean up repository after removing LFS cache files
- Includes sentence-transformers model (418MB)
- Pre-computed embeddings (293MB)
- NLTK WordNet data
- Configured Docker to use cache at /app/backend-py/cache
- Setup Git LFS for large files (899MB total)
Signed-off-by: Vimal Kumar <vimal78@gmail.com>
- Implement FastAPI backend with vector search and machine learning capabilities
- Add comprehensive crossword generation algorithm with bounds checking fixes
- Include multi-layer word caching system with graceful fallback to static words
- Add extensive test suite (unit tests, integration tests, boundary condition tests)
- Update Docker configuration for Python backend deployment
- Add comprehensive documentation and development setup guides
- Integrate sentence-transformers and FAISS for semantic word discovery
- Maintain API compatibility with existing Node.js backend
Signed-off-by: Vimal Kumar <vimal78@gmail.com>