Homepage of my Flask application is rendered correctly, but the issue arises when I click a button (submit) which takes me to another endpoint where instead of rendering that page, I get an error saying, "The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application."
I tried to referring to various sources, but couldn't come up with a solution
After several hours, I resolved it and there were 2 issues:
Sol: modify the file paths using os.path.join()
, which is a platform independent way of joining directory and file names. Change “artifacts/model.pkl” to os.path.join(“artifacts”, “model.pkl”)
Sol: change scikit-learn version in our virtual environment by specifying scikit-learn==1.2.2 in the requirements.txt file in our project directory and install it using pip install -r requirements.txt