fixed all tests, still need to check ctrl tf and pt and xlm tf
This commit is contained in:
@@ -317,28 +317,29 @@ class TFXLMModelLanguageGenerationTest(unittest.TestCase):
|
||||
@slow
|
||||
def test_lm_generate_xlm_mlm_en_2048(self):
|
||||
model = TFXLMWithLMHeadModel.from_pretrained("xlm-mlm-en-2048")
|
||||
input_ids = tf.convert_to_tensor([[1, 14, 2232, 26, 1]], dtype=tf.int32) # the dog is cute
|
||||
input_ids = tf.convert_to_tensor([[14, 447]], dtype=tf.int32) # the president
|
||||
expected_output_ids = [
|
||||
1,
|
||||
14,
|
||||
2232,
|
||||
26,
|
||||
1,
|
||||
567,
|
||||
26,
|
||||
32,
|
||||
149,
|
||||
149,
|
||||
149,
|
||||
149,
|
||||
149,
|
||||
149,
|
||||
149,
|
||||
149,
|
||||
149,
|
||||
149,
|
||||
149,
|
||||
149,
|
||||
] # The dog is nothing is it!!!!!!!!!!!! TODO (PVP): this sentence (and others I tried) does not make much sense, there seems to be a problem with xlm language generation.
|
||||
447,
|
||||
14,
|
||||
447,
|
||||
14,
|
||||
447,
|
||||
14,
|
||||
447,
|
||||
14,
|
||||
447,
|
||||
14,
|
||||
447,
|
||||
14,
|
||||
447,
|
||||
14,
|
||||
447,
|
||||
14,
|
||||
447,
|
||||
14,
|
||||
447,
|
||||
] # the president the president the president the president the president the president the president the president the president the president
|
||||
# TODO(PVP): this and other input_ids I tried for generation give pretty bad results. Not sure why. Model might just not be made for auto-regressive inference
|
||||
output_ids = model.generate(input_ids)
|
||||
self.assertListEqual(output_ids[0].tolist(), expected_output_ids, do_sample=False)
|
||||
|
||||
Reference in New Issue
Block a user