myownskyW7
commited on
Commit
•
1543e50
1
Parent(s):
18fb13d
Upload modeling_InternLM_XComposer.py
Browse files
modeling_InternLM_XComposer.py
CHANGED
@@ -81,8 +81,8 @@ conversation
|
|
81 |
# speed up init llm
|
82 |
with torch.device('meta'):
|
83 |
self.internlm_model = InternLMForCausalLM._from_config(config)
|
84 |
-
self.internlm_model.to_empty(device=
|
85 |
-
|
86 |
for n, m in self.internlm_model.named_modules():
|
87 |
if 'lora' in n:
|
88 |
m.float()
|
|
|
81 |
# speed up init llm
|
82 |
with torch.device('meta'):
|
83 |
self.internlm_model = InternLMForCausalLM._from_config(config)
|
84 |
+
self.internlm_model.to_empty(device='cpu').to(torch.float16)
|
85 |
+
self.internlm_model.to(config.device)
|
86 |
for n, m in self.internlm_model.named_modules():
|
87 |
if 'lora' in n:
|
88 |
m.float()
|