Skip to content

Commit

Permalink
Modify stable-diffusion's result format.
Browse files Browse the repository at this point in the history
  • Loading branch information
yao-fengchen committed Jan 12, 2024
1 parent 2ac6c2e commit 64cebe4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
Binary file not shown.
1 change: 0 additions & 1 deletion dicp/test/model/stable_diffusion/topsgraph_output.txt

This file was deleted.

10 changes: 4 additions & 6 deletions dicp/test/model/test_stable_diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,10 @@ def test_inference(
dicp_pipe.unet = torch.compile(dicp_pipe.unet, backend=backend)
dicp_image = dicp_pipe(prompt, num_inference_steps=num_inference_steps).images[0]
if backend == "ascendgraph":
with open("stable_diffusion/topsgraph_output.txt", "r") as f:
standard_output = eval(f.read())
standard_output = torch.load("stable_diffusion/ascendgraph_output.pt")
elif backend == "topsgraph":
with open("stable_diffusion/topsgraph_output.txt", "r") as f:
standard_output = eval(f.read())
standard_output = torch.load("stable_diffusion/topsgraph_output.pt")
else:
raise ValueError("backend should in (ascendgrap, topsgraph)")
dicp_output = list(dicp_image.getdata())
assert dicp_output == standard_output
dicp_output = torch.tensor(list(dicp_image.getdata()))
assert torch.allclose(dicp_output, standard_output, equal_nan=True)

0 comments on commit 64cebe4

Please sign in to comment.