AI is partially to thank for helping the struggling clothing rental service turn itself around.