Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses issue #212
Issues in
script.sh
andserver.py
have been resolvedChanges made:
Replaced all instances of the deprecated jors_winkler module with
jaro_winkler_similarity
inserver.py
andmain.py
to resolve the import error.Implemented a fallback mechanism to force the script to use the CPU instead of the GPU if insufficient VRAM is detected, addressing the CUDA out-of-memory error on devices with limited GPU memory.
Set the environment variable
os.environ["PYTORCH_CUDA_ALLOC_CONF"] = "expandable_segments:True"
to avoid memory fragmentation and improve GPU memory allocation handling.NOTE:
Two of the files I've added in this PR..
jaro_wrinkler.py
andconvert_score_and_distance_functions.py
should be replaced from their respective directories... namely:EduAid/backend/venv/lib/python3.12/site-packages/similarity/jaro_winkler.py
EduAid/backend/venv/lib/python3.12/site-packages/similarity/convert_score_and_distance_functions.py
These changes should fix the reported issues with the server script and improve the overall reliability on systems with limited GPU resources.