Upload modeling_slm.py with huggingface_hub
Browse files- modeling_slm.py +2 -2
modeling_slm.py
CHANGED
|
@@ -188,8 +188,8 @@ class SLMForCausalLM(PreTrainedModel, GenerationMixin):
|
|
| 188 |
) -> CausalLMOutputWithPast:
|
| 189 |
B, T = input_ids.shape
|
| 190 |
x = self.embed(input_ids)
|
| 191 |
-
cos = self.rope_cos[:T].to(x.device)
|
| 192 |
-
sin = self.rope_sin[:T].to(x.device)
|
| 193 |
|
| 194 |
for block in self.blocks:
|
| 195 |
x = block(x, cos, sin, attention_mask)
|
|
|
|
| 188 |
) -> CausalLMOutputWithPast:
|
| 189 |
B, T = input_ids.shape
|
| 190 |
x = self.embed(input_ids)
|
| 191 |
+
cos = self.rope_cos[:T].to(dtype=x.dtype, device=x.device)
|
| 192 |
+
sin = self.rope_sin[:T].to(dtype=x.dtype, device=x.device)
|
| 193 |
|
| 194 |
for block in self.blocks:
|
| 195 |
x = block(x, cos, sin, attention_mask)
|