"docs/source/vscode:/vscode.git/clone" did not exist on "5964f820db1568d26298b37dea9db328185c7f7c"
Unverified Commit 5ae087cf authored by Matt's avatar Matt Committed by GitHub
Browse files

Fix T5/mT5 tests (#18029)

parent ec07eccc
......@@ -67,7 +67,7 @@ class TFMT5ModelIntegrationTest(unittest.TestCase):
labels = tokenizer("Hi I am", return_tensors="tf").input_ids
loss = model(input_ids, labels=labels).loss
mtf_score = -tf.math.reduce_sum(loss).numpy()
mtf_score = -tf.math.reduce_mean(loss).numpy()
EXPECTED_SCORE = -84.9127
EXPECTED_SCORE = -21.210594
self.assertTrue(abs(mtf_score - EXPECTED_SCORE) < 2e-4)
......@@ -659,9 +659,9 @@ class TFT5ModelIntegrationTests(unittest.TestCase):
labels = tokenizer("Hi I am", return_tensors="tf").input_ids
loss = model(input_ids, labels=labels).loss
mtf_score = -tf.math.reduce_sum(loss).numpy()
mtf_score = -tf.math.reduce_mean(loss).numpy()
EXPECTED_SCORE = -19.0845
EXPECTED_SCORE = -4.7710114
self.assertTrue(abs(mtf_score - EXPECTED_SCORE) < 1e-4)
@slow
......@@ -685,9 +685,9 @@ class TFT5ModelIntegrationTests(unittest.TestCase):
labels = tokenizer("Hi I am", return_tensors="tf").input_ids
loss = model(input_ids, labels=labels).loss
mtf_score = -tf.math.reduce_sum(loss).numpy()
mtf_score = -tf.math.reduce_mean(loss).numpy()
EXPECTED_SCORE = -59.0293
EXPECTED_SCORE = -14.759922
self.assertTrue(abs(mtf_score - EXPECTED_SCORE) < 1e-4)
@slow
......@@ -709,9 +709,9 @@ class TFT5ModelIntegrationTests(unittest.TestCase):
labels = tokenizer("Hi I am", return_tensors="tf").input_ids
loss = model(input_ids, labels=labels).loss
mtf_score = -tf.math.reduce_sum(loss).numpy()
mtf_score = -tf.math.reduce_mean(loss).numpy()
EXPECTED_SCORE = -60.7397
EXPECTED_SCORE = -7.594554
self.assertTrue(abs(mtf_score - EXPECTED_SCORE) < 1e-4)
@slow
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment