Man accused of attacking girlfriend with machetes