Plat commited on
Commit
31cd180
·
1 Parent(s): b66d2d1

chore: move in spaces func

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -41,7 +41,6 @@ model = load_ip_adapter_model(
41
  config_path=adapter_config_path,
42
  adapter_path=adapter_model_path,
43
  )
44
- model.to("cuda:0")
45
 
46
 
47
  @spaces.GPU
@@ -64,6 +63,7 @@ def on_generate(
64
  seed = random.randint(0, 2147483647)
65
 
66
  with torch.inference_mode(), torch.autocast("cuda", dtype=torch.bfloat16):
 
67
  images = model.generate(
68
  prompt=[prompt] * num_images, # batch size 4
69
  negative_prompt=negative_prompt,
 
41
  config_path=adapter_config_path,
42
  adapter_path=adapter_model_path,
43
  )
 
44
 
45
 
46
  @spaces.GPU
 
63
  seed = random.randint(0, 2147483647)
64
 
65
  with torch.inference_mode(), torch.autocast("cuda", dtype=torch.bfloat16):
66
+ model.to("cuda:0")
67
  images = model.generate(
68
  prompt=[prompt] * num_images, # batch size 4
69
  negative_prompt=negative_prompt,