code: def _sacrebleu_chrf_fn(
      preds: Sequence[str],
      targets: Sequence[Sequence[str]],
      char_order: int,
      word_order: int,
      lowercase: bool,
      whitespace: bool,
  ) -> Tensor:
      sacrebleu_chrf = CHRF(
          char_order=char_order,
          word_order=word_order,
          lowercase=lowercase,
          whitespace=whitespace,
          eps_smoothing=True,
      )
      # Sacrebleu CHRF expects different format of input
      targets = [
          [target[i] for target in targets]
          for i in range(len(targets[0]))
      ]
      sacrebleu_chrf = (
          sacrebleu_chrf.corpus_score(preds, targets).score / 100
      )
      return tensor(sacrebleu_chrf)
  
file_path: torchmetrics/tests/unittests/text/test_chrf.py
imports: from functools import partial
  from typing import Sequence
  import pytest
  from torch import Tensor, tensor
  from torchmetrics.functional.text.chrf import chrf_score
  from torchmetrics.text.chrf import CHRFScore
  from torchmetrics.utilities.imports import _SACREBLEU_AVAILABLE
  from unittests.text.helpers import TextTester
  from unittests.text.inputs import _inputs_multiple_references, _inputs_single_sentence_multiple_references
label_desc: Use image node_id 1 for calling a global function with example usage: _sacrebleu_chrf_fn(preds, targets, char_order, word_order, lowercase, whitespace) and returns: tensor