It's cool that you can immediately update the output whenever the input changes.
But what if the code inside the function changes? Do you have hot reloading functionality?
Streamlit handles this by re-executing the whole script when detecting any code changes. You can cache certain resources (such as the model), but it's fiddly to get right.