Hey I have this website where it is allows people to add a new prediction. First they click a new prediction and and ad data (csvs) then choose the machine learning model they want to use and then it should run the python code and output a csv to a database with the relevant prediction parameters.
My question is how should I have the python code be ran as this code could take up to a few hours to run and then I have to account for many users trying to make new predictions. I have looked into task scheduling and redis. I have also heard I could use some AWS services but I am unsure what is the best option here as I want to prevent memory errors and timeouts as much as possible while making sure the code is ran in a stable environment.
By the way I am using flask as the back end and react on the frontend