San Francisco chief releases racist texts, orders training