Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -135,7 +135,7 @@ def main():
|
|
135 |
if ptuning_checkpoint is not None:
|
136 |
print(f"Loading prefix_encoder weight from {ptuning_checkpoint}")
|
137 |
model = AutoModel.from_pretrained("THUDM/chatglm-6b-int4", config=config, trust_remote_code=True)
|
138 |
-
prefix_state_dict = torch.load(os.path.join(ptuning_checkpoint, "pytorch_model.bin"))
|
139 |
new_prefix_state_dict = {}
|
140 |
for k, v in prefix_state_dict.items():
|
141 |
if k.startswith("transformer.prefix_encoder."):
|
|
|
135 |
if ptuning_checkpoint is not None:
|
136 |
print(f"Loading prefix_encoder weight from {ptuning_checkpoint}")
|
137 |
model = AutoModel.from_pretrained("THUDM/chatglm-6b-int4", config=config, trust_remote_code=True)
|
138 |
+
prefix_state_dict = torch.load(os.path.join(ptuning_checkpoint, "pytorch_model.bin"), map_location='cpu')
|
139 |
new_prefix_state_dict = {}
|
140 |
for k, v in prefix_state_dict.items():
|
141 |
if k.startswith("transformer.prefix_encoder."):
|