So I marked jhon_how’s answer as upgrading pytorch was my only way to get rid of this error also. However, I have to try running everything via docker as mentioned on this post Building PyTorch 2.6.0 from source on macOS x86_64 (Intel) As my workstation is Intel-based macOS, I had to take an extra step described in the above link.
Thank you so much for the inputs everyone