code: def test_sacrebleu():
      predictions = ["hello there general kenobi", "foo bar foobar"]
      references = [
          ["hello there general kenobi", "hello there !"],
          ["foo bar foobar", "foo bar foobar"],
      ]
      import evaluate
  
      sacrebleu = evaluate.load("sacrebleu")
      results = sacrebleu.compute(
          predictions=predictions, references=references
      )
  
      assert list(results.keys()) == [
          "score",
          "counts",
          "totals",
          "precisions",
          "bp",
          "sys_len",
          "ref_len",
      ]
      assert round(results["score"], 1) == 100.0
  
      predictions = [
          "hello there general kenobi",
          "on our way to ankh morpork",
      ]
      references = [
          ["hello there general kenobi", "hello there !"],
          ["goodbye ankh morpork", "ankh morpork"],
      ]
      sacrebleu = evaluate.load("sacrebleu")
      results = sacrebleu.compute(
          predictions=predictions, references=references
      )
      assert list(results.keys()) == [
          "score",
          "counts",
          "totals",
          "precisions",
          "bp",
          "sys_len",
          "ref_len",
      ]
      assert round(results["score"], 1) == 39.8
  
file_path: h2ogpt/tests/test_metrics.py
imports: from tests.utils import wrap_test_forked
label_desc: Use image node_id 2 for calling a global function with example usage: test_sacrebleu() without return types