move loading code to main and fix transpose models