Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions mlx-lm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pub mod utils;
use mlx_rs::Array;

use crate::models::qwen3;
use crate::models::qwen3_5;

pub struct ModelInputBuilder<'a, C, T> {
pub y: &'a Array,
Expand All @@ -31,6 +32,18 @@ impl<'a, C> ModelInput<'a, C, Option<Array>> for qwen3::ModelInput<'a, C> {
}
}

impl<'a, C> ModelInput<'a, C, Option<Array>> for qwen3_5::ModelInput<'a, C> {
fn from_model_input_builder(builder: ModelInputBuilder<'a, C, Option<Array>>) -> Self {
let ModelInputBuilder { y, cache, state } = builder;

Self {
inputs: y,
mask: state.as_ref(),
cache,
}
}
}

pub trait ModelOutput {
fn logits(&self) -> &Array;
}
Expand Down
1 change: 1 addition & 0 deletions mlx-lm/src/models/mod.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
pub mod llama;
pub mod qwen3;
pub mod qwen3_5;
Loading