I think there are three main factors to analyze. The first is financial of course, which nets you more profit? Selling the building generates one large payment but could take longer to sell. Selling the units may net you more but come in smaller amounts, meanwhile you're still carrying the building and dealing with a much larger number of transactions.
Which is the second factor. Selling the building would be a commercial transaction and would involve dealing with a more sophisticated (businesslike) buyer, in theory at least. Selling the units means dealing with multiple resi buyers (and their agents) whose buying process is much more emotionally driven and less defined. Much more transactional 'brain damage' that way.
The third factor is legal risk. If the property is in a litigious pro-buyer condo market (CA for instance) it would be more likely that post sale legal complications would come up selling the units to retail buyers than with a commercial sale.
I would recommend researching both alternatives by finding the top two or three commercial brokers for that size property in the market and using their input develop a market price and timeline to sale that factors in all the out of pocket costs of marketing and selling the building. Then I would do the same with the top condo agents for selling the units.
If selling the building pencils out proceed to sale. If selling the units looked more rewarding I would review the litigation risks with your real estate attorney to understand what your exposure would be before listing the units.
Good hunting-