Update app.py
Browse files
app.py
CHANGED
@@ -101,13 +101,14 @@ def loadModel():
|
|
101 |
device_map="auto",
|
102 |
quantization_config=quantization_config,
|
103 |
max_memory={
|
104 |
-
0: "
|
105 |
-
1: "
|
106 |
-
2: "
|
107 |
-
3: "
|
108 |
#"cpu": "5GB" # CPU with 100GB memory
|
109 |
},
|
110 |
)
|
|
|
111 |
model = PeftModel.from_pretrained(
|
112 |
model,
|
113 |
lora_weights,
|
@@ -116,10 +117,10 @@ def loadModel():
|
|
116 |
torch_dtype=torch.float16,
|
117 |
is_trainable=False,
|
118 |
max_memory={
|
119 |
-
0: "
|
120 |
-
1: "
|
121 |
-
2: "
|
122 |
-
3: "
|
123 |
#"cpu": "5GB" # CPU with 100GB memory
|
124 |
},
|
125 |
)
|
|
|
101 |
device_map="auto",
|
102 |
quantization_config=quantization_config,
|
103 |
max_memory={
|
104 |
+
0: "20GB", # GPU 0 with 20GB memory
|
105 |
+
1: "45GB", # GPU 0 with 20GB memory
|
106 |
+
2: "5GB", # GPU 0 with 20GB memory
|
107 |
+
#3: "1GB", # GPU 0 with 20GB memory
|
108 |
#"cpu": "5GB" # CPU with 100GB memory
|
109 |
},
|
110 |
)
|
111 |
+
print_resources()
|
112 |
model = PeftModel.from_pretrained(
|
113 |
model,
|
114 |
lora_weights,
|
|
|
117 |
torch_dtype=torch.float16,
|
118 |
is_trainable=False,
|
119 |
max_memory={
|
120 |
+
#0: "1GB", # GPU 0 with 20GB memory
|
121 |
+
#1: "5GB", # GPU 0 with 20GB memory
|
122 |
+
2: "35GB", # GPU 0 with 20GB memory
|
123 |
+
3: "40GB", # GPU 0 with 20GB memory
|
124 |
#"cpu": "5GB" # CPU with 100GB memory
|
125 |
},
|
126 |
)
|