Can weight gain be avoided on valproate?

Can't. You can't avoid this side effect, but what you can do is, talk to yo ur doc, and set up a plan to apply some other means to correct weight gain, such as excercise etc.