pub enum RopeScaling {
None,
Linear {
factor: f64,
},
Llama3 {
factor: f64,
low_freq_factor: f64,
high_freq_factor: f64,
original_max_position_embeddings: usize,
},
Yarn {
factor: f64,
original_max_position_embeddings: usize,
beta_fast: f64,
beta_slow: f64,
attention_factor: Option<f64>,
},
LongRope {
short_factor: Vec<f64>,
long_factor: Vec<f64>,
original_max_position_embeddings: usize,
factor: f64,
attention_factor: Option<f64>,
},
}Expand description
RoPE frequency scaling, parsed from HF rope_scaling (accepts both the
modern rope_type and the legacy type key). Table math lives in
combs-models::rope; this is parse-only.
Variants§
None
Linear
Llama3
Llama-3.1+ piecewise frequency scaling.
Fields
Yarn
YaRN NTK-by-parts interpolation (+ attention temperature).
Fields
LongRope
Phi-3 LongRoPE: per-dimension frequency divisors, one set for prompts within the pretraining context and one beyond it.
Trait Implementations§
Source§impl Clone for RopeScaling
impl Clone for RopeScaling
Source§fn clone(&self) -> RopeScaling
fn clone(&self) -> RopeScaling
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RopeScaling
impl Debug for RopeScaling
Source§impl Default for RopeScaling
impl Default for RopeScaling
Source§fn default() -> RopeScaling
fn default() -> RopeScaling
Returns the “default value” for a type. Read more
Source§impl PartialEq for RopeScaling
impl PartialEq for RopeScaling
impl StructuralPartialEq for RopeScaling
Auto Trait Implementations§
impl Freeze for RopeScaling
impl RefUnwindSafe for RopeScaling
impl Send for RopeScaling
impl Sync for RopeScaling
impl Unpin for RopeScaling
impl UnsafeUnpin for RopeScaling
impl UnwindSafe for RopeScaling
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more