Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve question generation efficiency In Response Relevancy metrics (#…
…1810) **Description**: This update refactors the _ascore method to use asyncio.gather for parallel execution of question generation tasks. Key improvements include: **Issue** : When ResponseRelevancy evaluation loops based on the strictness variable (default 3), which is taking longer than expected **Performance Enhancement**: By processing all tasks concurrently, the overall execution time is significantly reduced, especially for high strictness values. **Code Simplification**: The refactored code is more concise and aligns better with Python's asynchronous programming patterns. **Scalability**: The new implementation handles a larger number of tasks without blocking, making it more suitable for use cases requiring high concurrency. **Backward Compatibility**: All existing functionality remains intact, with no changes required to external interfaces. This change improves the efficiency and maintainability of the codebase, aligning with best practices for asynchronous programming in Python. Result after resolution : Average 1 run of Example code based on tutorial code (10 runs total) reduced to 4.35s => 2.82s
- Loading branch information