Are we even sure Pelosi will run again? I believe she said she would have retired last cycle if Hillary had won.
Well if she thinks she stands an actual chance of becoming Speaker again I can't see why she'd retire. She's spent the last several years in opposition, I imagine she'd want to retire having been Speaker again. Looks better for the legacy.
Now if the dems do fail to capture the house, which I think is still more likely than not, maybe she will retire. I don't think so though. I think she wants to be a vocal part of the Trump resistance and opposing him has really given her a new zest as it were.