A cannabis farm spread over four floors of a disused building in a town centre has been raided by police and shut down.