AlekseyCalvin commited on
Commit
7a558f7
·
verified ·
1 Parent(s): 5adf4dc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -30,7 +30,7 @@ with open('loras.json', 'r') as f:
30
 
31
  # Initialize the base model with authentication and specify the device
32
  # Initialize the base model with authentication and specify the device
33
- pipe = DiffusionPipeline.from_pretrained("sayakpaul/FLUX.1-merged", torch_dtype=dtype, token=hf_token, trust_remote_code=True, device_map='auto').to(device)
34
 
35
  MAX_SEED = np.iinfo(np.int32).max
36
  MAX_IMAGE_SIZE = 2048
@@ -50,7 +50,7 @@ device_map = infer_auto_device_map(
50
  dtype='float16'
51
  )
52
 
53
- model = dispatch_model(model, device_map=device_map)
54
 
55
  class calculateDuration:
56
  def __init__(self, activity_name=""):
 
30
 
31
  # Initialize the base model with authentication and specify the device
32
  # Initialize the base model with authentication and specify the device
33
+ pipe = DiffusionPipeline.from_pretrained("sayakpaul/FLUX.1-merged", torch_dtype=dtype, token=hf_token, trust_remote_code=True, device_map='balanced').to(device)
34
 
35
  MAX_SEED = np.iinfo(np.int32).max
36
  MAX_IMAGE_SIZE = 2048
 
50
  dtype='float16'
51
  )
52
 
53
+ model = dispatch_model(model, device_map='balanced')
54
 
55
  class calculateDuration:
56
  def __init__(self, activity_name=""):