mirror of
https://github.com/huggingface/candle.git
synced 2025-06-18 03:28:50 +00:00
Add min to buckets in relative_position_bucket (#1312)
This commit is contained in:
@ -462,7 +462,7 @@ impl T5Attention {
|
|||||||
self.relative_attention_max_distance as f32
|
self.relative_attention_max_distance as f32
|
||||||
/ max_exact as f32,
|
/ max_exact as f32,
|
||||||
) * (num_buckets - max_exact) as f32;
|
) * (num_buckets - max_exact) as f32;
|
||||||
max_exact + b as u32
|
u32::min(max_exact + b as u32, num_buckets - 1)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.collect::<Vec<u32>>()
|
.collect::<Vec<u32>>()
|
||||||
|
Reference in New Issue
Block a user