function for getting model by input string