is it you that is being attacked? walk away until the other person is calm, fix a bolt to the inside of a bedroom door and make sure your mobile phone is handy and charged at all times.
Keep yourself safe at all times.
How often is it happening and to what severity? Is there a trigger?
Talk to your loved one's doctor (the psychiatrist or GP) or Mental health nurse too. It's just possible that tweaking the medication a bit could control the violence. My Mum was less violent and less often violent after her medication was tweaked.