(
content: &candle_core::quantized::gguf_file::Content,
key: &str,
)
| 324 | } |
| 325 | |
| 326 | fn get_f32( |
| 327 | content: &candle_core::quantized::gguf_file::Content, |
| 328 | key: &str, |
| 329 | ) -> Option<f32> { |
| 330 | use candle_core::quantized::gguf_file::Value; |
| 331 | match content.metadata.get(key)? { |
| 332 | Value::F32(v) => Some(*v), |
| 333 | Value::F64(v) => Some(*v as f32), |
| 334 | _ => None, |
| 335 | } |
| 336 | } |
| 337 | |
| 338 | #[cfg(test)] |
| 339 | mod tests { |