Skip to content

Commit

Permalink
test named outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
deigen committed Mar 2, 2025
1 parent 77f16bc commit 7c65b7a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/runners/test_model_signatures.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,12 @@ def f(self, prompt: str, images: List[Image]) -> (str, List[Image]):
testimg1 = Image.fromarray(np.ones([50, 50, 3], dtype="uint8"))
testimg2 = Image.fromarray(200 + np.zeros([50, 50, 3], dtype="uint8"))
result = client.f('prompt', [testimg1, testimg2])
self.assertEqual(result[0], 'prompt result')
self.assertEqual(len(result[1]), 2)
self.assertTrue(np.all(result[1][0].to_numpy() == np.asarray(ImageOps.invert(testimg1))))
self.assertTrue(np.all(result[1][1].to_numpy() == np.asarray(ImageOps.invert(testimg2))))
assert len(result) == 2
(result_prompt, result_images) = result
self.assertEqual(result_prompt, 'prompt result')
self.assertEqual(len(result_images), 2)
self.assertTrue(np.all(result_images[0].to_numpy() == np.asarray(ImageOps.invert(testimg1))))
self.assertTrue(np.all(result_images[1].to_numpy() == np.asarray(ImageOps.invert(testimg2))))

def test_ndarrayint__ndarrayfloat(self):

Expand Down

0 comments on commit 7c65b7a

Please sign in to comment.