Test running a model with parameters.
(self)
| 34 | self.assertIsInstance(result.output, str, "returns output") |
| 35 | |
| 36 | def test_params_with_kwargs(self): |
| 37 | """Test running a model with parameters.""" |
| 38 | input_text = "Jack and Jill " |
| 39 | result = model.run( |
| 40 | input_text, params={"min_new_tokens": 1, "max_new_tokens": 1} |
| 41 | ) |
| 42 | |
| 43 | self.assertIsNone(result.error) |
| 44 | self.assertIsInstance(result.output, str, "returns output") |
| 45 | self.assertEqual( |
| 46 | len(result.output.split(" ")), |
| 47 | len(input_text.strip().split(" ")) + 1, |
| 48 | "returns output", |
| 49 | ) |
| 50 | def test_params(self): |
| 51 | """Test running a model with parameters.""" |
| 52 | input_text = "Jack and Jill " |