BUG: Invalid EMBEDDING_MAX_BATCH_SIZE Value Triggers ValueError in backend/config.py
Is there an existing issue for this?
- [x] I have searched the existing issues
What happened?
π Issue Overview
EMBEDDING_MAX_BATCH_SIZE Crashes Application if Set to Non-Integer Value
π Steps to Reproduce
- Set the environment variable
EMBEDDING_MAX_BATCH_SIZEto a non-integer value (e.g.,abcor leave it empty). - Run the application.
- The application attempts to convert the value to
intinbackend/config.py. - Show the error.
π― Expected Behavior
The application should handle invalid or missing EMBEDDING_MAX_BATCH_SIZE values gracefully and fall back to a safe default without crashing.
π¨ Actual Behavior
If EMBEDDING_MAX_BATCH_SIZE is set to a non-integer value or is empty, the application crashes with a ValueError in backend/config.py.
π· Screenshot
π‘ Suggested Improvements
- Add error handling in
backend/config.pyto catch invalidEMBEDDING_MAX_BATCH_SIZEvalues. - Use the default value if parsing fails.
Record
- [x] I agree to follow this project's Code of Conduct
- [x] I want to work on this issue
Hi maintainers! π
I would like to work on this issue.
It looks like the EMBEDDING_MAX_BATCH_SIZE in backend/config.py is currently setting a value that exceeds the expected limit, which triggers the ValueError during initialization.
I can fix this by:
- Investigating the validator logic in
config.py. - Adjusting the default value or adding a constraint check to ensure the batch size remains within valid limits.
Could you please assign this issue to me? I can submit a PR for this by tomorrow.
@smokeyScraper Hi there! I created issue #244 and have just uploaded my fix. I noticed a concurrent PR was opened, but I would ask you to consider my PR because it includes error-handling logic that prevents the server from failing to start due to configuration typos.
Hi @itzsudipta, thanks for pointing this out and for working on the fix π
Iβve pushed PR #247 with a defensive fallback for EMBEDDING_MAX_BATCH_SIZE to prevent startup crashes when the env var is invalid or missing. Happy to adjust or improve it if needed, or even align with your approach if maintainers prefer a single consolidated solution.
Leaving it to the maintainers to decide which PR fits best β Iβm happy to help either way π
Hi, Iβm Mohammad, a BTech AI student exploring Devr.AI for GSoC. Iβve reviewed this issue and would like to work on fixing it if thatβs okay. Iβll add proper validation and safe fallback for invalid values.
Thanks for the update! Looks like there are already PRs addressing this. Iβll look for another issue to contribute to. Appreciate the work here π