Test running a model with parameters.
(self)
| 48 | "returns output", |
| 49 | ) |
| 50 | def test_params(self): |
| 51 | """Test running a model with parameters.""" |
| 52 | input_text = "Jack and Jill " |
| 53 | result = model.run( |
| 54 | input_text, {"min_new_tokens": 1, "max_new_tokens": 1} |
| 55 | ) |
| 56 | |
| 57 | self.assertIsNone(result.error) |
| 58 | self.assertIsInstance(result.output, str, "returns output") |
| 59 | self.assertEqual( |
| 60 | len(result.output.split(" ")), |
| 61 | len(input_text.strip().split(" ")) + 1, |
| 62 | "returns output", |
| 63 | ) |
| 64 | def test_stream_kwargs(self): |
| 65 | """Test streaming text.""" |
| 66 | stream = model.run("Jack and jill", stream=True) |