Skip to content

Commit c591a5d

Browse files
authored
Merge branch 'main' into lyzju2019/support-llama
2 parents 5ec0332 + af21d79 commit c591a5d

File tree

9 files changed

+22
-19
lines changed

9 files changed

+22
-19
lines changed

.github/workflows/validate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
strategy:
3030
matrix:
3131
runner: [macos-15]
32-
rust: [1.93.1, stable]
32+
rust: [1.85.0, stable]
3333
steps:
3434
- uses: actions/checkout@v5
3535
with:

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ keywords = ["mlx", "deep-learning", "machine-learning"]
1313
categories = ["science"]
1414
license = "MIT OR Apache-2.0"
1515
documentation = "https://oxideai.github.io/mlx-rs/mlx_rs/"
16-
rust-version = "1.83.0"
16+
rust-version = "1.85.0"
1717

1818
[workspace]
1919
members = [
@@ -59,7 +59,7 @@ syn = { version = "2", features = ["full"] }
5959
quote = "1"
6060
darling = "0.21"
6161
proc-macro2 = "1"
62-
bindgen = "0.72"
62+
bindgen = "0.72.1"
6363
cmake = "0.1"
6464
cc = "1"
6565
safetensors = "0.6"

mlx-internal-macros/src/shared.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,17 @@ impl BuilderStructAnalyzer<'_> {
5555
let doc = format!("Builder for `{struct_ident}`.");
5656

5757
let mandatory_field_doc = format!("See [`{struct_ident}`] for more information.");
58-
let optional_field_doc =
59-
optional_field_idents
60-
.iter()
61-
.zip(optional_field_defaults)
62-
.map(|(ident, default)| {
63-
format!(
58+
let optional_field_doc = optional_field_idents
59+
.iter()
60+
.zip(optional_field_defaults)
61+
.map(|(ident, default)| {
62+
format!(
6463
"See [`{}::{}`] for more information. Initialized with default value [`{}`].",
65-
struct_ident, ident, default.to_token_stream()
64+
struct_ident,
65+
ident,
66+
default.to_token_stream()
6667
)
67-
});
68+
});
6869

6970
quote! {
7071
#[doc = #doc]
@@ -319,7 +320,7 @@ fn parse_fields(fields: &syn::Fields) -> Result<(Vec<MandatoryField>, Vec<Option
319320
None => {
320321
return Err(
321322
format!("Field {ident} is optional but has no default value").into(),
322-
)
323+
);
323324
}
324325
};
325326

mlx-lm-utils/src/error.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ pub enum Error {
77
/// applying the chat template! This can happen if the chat template deletes portions of
88
/// the final message. Please verify the chat template and final message in your chat to
99
/// ensure they are compatible.
10-
#[error("continue_final_message is set but the final message does not appear in the chat after applying the chat template!")]
10+
#[error(
11+
"continue_final_message is set but the final message does not appear in the chat after applying the chat template!"
12+
)]
1113
FinalMsgNotInChat,
1214

1315
#[error(transparent)]

mlx-lm/src/models/qwen3.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ where
402402
None => match create_attention_mask(&h, cache, Some(true))? {
403403
Some(AttentionMask::Array(a)) => Some(a),
404404
Some(AttentionMask::Causal) => {
405-
return Err(Exception::custom("Only `Array` mask is supported"))
405+
return Err(Exception::custom("Only `Array` mask is supported"));
406406
}
407407
None => None,
408408
},

mlx-lm/src/utils/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ where
220220
_ => {
221221
return Err(Exception::custom(
222222
"Both keys and values must be quantized when KV cache is quantized",
223-
))
223+
));
224224
}
225225
};
226226

@@ -237,7 +237,7 @@ where
237237
_ => {
238238
return Err(Exception::custom(
239239
"Both keys and values must NOT be quantized when KV cache is NOT quantized",
240-
))
240+
));
241241
}
242242
};
243243

mlx-macros/src/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub(crate) fn filter_fields_with_attr<'a>(
2929
return Err(syn::Error::new_spanned(
3030
fields,
3131
"Struct with unnamed fields is not supported".to_string(),
32-
))
32+
));
3333
}
3434
}
3535

mlx-rs/src/utils/io.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ impl SafeTensors {
114114
1 => {
115115
return Err(crate::error::get_and_clear_last_mlx_error()
116116
.expect("A non-success status was returned, but no error was set.")
117-
.into())
117+
.into());
118118
}
119119
2 => break,
120120
_ => unreachable!(),

0 commit comments

Comments
 (0)