def deactivate_neftune(model, neftune_hook_handle):
    """
    Deactivates the neftune method. Make sure to call `_activate_neftune` first.
    """
    embeddings = unwrap(model).get_input_embeddings()

    neftune_hook_handle.remove()
    del embeddings.neftune_noise_alpha

    Deactivates the neftune method. Make sure to call `_activate_neftune` first.
    
train/colossalai_llm4decompile/colossal_llama/utils/neftune_patch.py