code: def evaluate_model(model, dataloader):
      model.eval()
      n_examples = 0
      accumulated_loss = torch.zeros(1, dtype=torch.float64).cuda()
      accuracy = torch.zeros(1, dtype=torch.float64).cuda()
  
      for batch in dataloader:
          batch = move_to(batch, torch.cuda.current_device())
          speakers = torch.tensor(batch["rest"][2]).cuda()
  
          speaker_logprobs = model(batch)
          loss = F.nll_loss(speaker_logprobs, speakers)
          accumulated_loss += loss
  
          accuracy += (
              speaker_logprobs.argmax(dim=-1) == speakers
          ).sum()
          n_examples += speakers.size(0)
  
      accumulated_loss /= n_examples
      accuracy /= n_examples
  
      print(
          f"Valid loss: {accumulated_loss.item()}, accuracy: {accuracy.item()}"
      )
  
file_path: textlesslib/examples/speaker_probing/train.py
imports: import torch
  import argparse
  from textless.data.quantized_datasets import QuantizedLibriSpeech
  from torch.utils.data import DataLoader
  import torch.nn.functional
  from probes import ContinuousClassifier, DiscreteClassifier, ConstantBaseline
  from textless.data.speech_encoder import SpeechEncoder
  from textless import dispatch_dense_model, dispatch_quantizer
label_desc: Use image node_id 6 for calling a global function with example usage: evaluate_model(model, dataloader) without return types