text_plain_output_1.png
from torch import nn

from transformers import AutoModel

import torch

import torch
from torch import nn
from transformers import AutoModel
@torch.no_grad()
def turn_off_dropout(module: nn.Module) -> None:
    if isinstance(module, nn.Dropout):
        module.p = 0.0
model_path = 'distilbert-base-uncased'
model = AutoModel.from_pretrained(model_path)
model.apply(turn_off_dropout)
model