def close_communicator(self):
        """
        Closes the weight update group and cleans up the communication group.
        """
        url = f'{self.base_url}/close_communicator/'

        try:
            response = self.session.post(url)
        except ConnectionError:
            # The server might be already down, so we don't need to close the communicator
            pass
        else:
            if response.status_code != 200:
                raise Exception(f'Request failed: {response.status_code}, {response.text}')

        Closes the weight update group and cleans up the communication group.
        
swift/trainers/rlhf_trainer/vllm_client.py