I agree with mrudzki, & the ? has already been asked about the size of tank, so if it is big enough I would use a divider to separate them - are they the only fish in the tank?
In this case I would say that it has more to do with the character of the barbs than anything else. I wouldn't recommend keeping any barb species with guppies. Even though the cherry barb is one of the least aggressive of the barbs, they can be very nippy particularly to long finned fish, as you have discovered.
Cherry barbs are loose/semi shoaling fish (unlike most barb species), & will often go off by themselves, they seem to prefer that, so a bigger shoal may not help in this situation, if that was a consideration.
The poor guppy is always a target for any nippy fish.