File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import sys
2+ import os
3+ from .lib import getMinio , getDDA
4+ from test import runTest
5+
6+
7+ class TestAttnProcs :
8+ def test_hf_download (self ):
9+ """
10+ Make sure when switching models we release VRAM afterwards.
11+ """
12+ dda = getDDA (
13+ stream_logs = True ,
14+ )
15+ print (dda )
16+
17+ TEST_ARGS = {"test_url" : dda .url }
18+
19+ mem_usage = list ()
20+
21+ # fp32 model is obviously bigger
22+ result = runTest (
23+ "txt2img" ,
24+ TEST_ARGS ,
25+ {
26+ "MODEL_ID" : "runwayml/stable-diffusion-v1-5" ,
27+ "MODEL_REVISION" : "fp16" ,
28+ "MODEL_PRECISION" : "fp16" ,
29+ "attn_procs" : "patrickvonplaten/lora_dreambooth_dog_example" ,
30+ },
31+ {
32+ "num_inference_steps" : 1 ,
33+ "prompt" : "A picture of a sks dog in a bucket" ,
34+ "seed" : 1 ,
35+ "cross_attention_kwargs" : {"scale" : 0.5 },
36+ },
37+ )
38+
39+ assert result ["image_base64" ]
40+ dda .stop ()
You can’t perform that action at this time.
0 commit comments