SQLModel hot-reload solution: InvalidRequestError: Multiple classes found for path

I found out how to deal with this error that happens after reloading. I simply put:

from sqlmodel.main import default_registry

default_registry.dispose()

before the instatiation of my table classes. Maybe the error was the mappers being created after the program reading classes definition. So disposing the old mappers before the classes definition solved.

Could someone confirm this?