MCPcopy Create free account
hub / github.com/Pints-AI/1.5-Pints / get_rope_cache

Method get_rope_cache

lit_gpt/model.py:193–201  ·  view source on GitHub ↗
(self, device: Optional[torch.device] = None)

Source from the content-addressed store, hash-verified

191 return cls(Config.from_name(name, **kwargs))
192
193 def get_rope_cache(self, device: Optional[torch.device] = None) -> Tuple[torch.Tensor, torch.Tensor]:
194 return build_rope_cache(
195 seq_len=self.max_seq_length,
196 n_elem=self.config.rope_n_elem,
197 device=device,
198 condense_ratio=self.config.rope_condense_ratio,
199 base=self.config.rope_base,
200 dtype=torch.bfloat16
201 )
202
203 def build_rope_cache(self, idx: torch.Tensor) -> RoPECache:
204 return build_rope_cache(

Callers 2

max_seq_lengthMethod · 0.95
reset_parametersMethod · 0.95

Calls 1

build_rope_cacheFunction · 0.85

Tested by

no test coverage detected