Add Qwen vision loading and Metal inference
This commit is contained in:
1 parent
48c2f751b4
commit
e32954ac1b
30 files changed
+1687
-100
No files matched your search
@@ -27,6 +27,8 @@ pub(super) struct Identity {
|
||||
struct Manifest {
|
||||
identity: Identity,
|
||||
tag: [u8; 32],
|
||||
#[serde(default)]
|
||||
images: Vec<crate::engine::qwen_vision::Identity>,
|
||||
tokens: Vec<i32>,
|
||||
lazy_kv: bool,
|
||||
payload: serde_json::Value,
|
||||
@@ -111,6 +113,7 @@ impl LiveSession {
|
||||
let manifest = serde_json::to_vec(&Manifest {
|
||||
identity,
|
||||
tag,
|
||||
images: self.current_images.clone(),
|
||||
tokens: saved.token_ids.clone(),
|
||||
lazy_kv: saved.lazy_kv,
|
||||
payload,
|
||||
@@ -230,6 +233,8 @@ impl LiveSession {
|
||||
self.current = Some(saved);
|
||||
self.prefix = None;
|
||||
self.tag = manifest.tag;
|
||||
self.current_images = manifest.images;
|
||||
self.prefix_images.clear();
|
||||
Ok(true)
|
||||
}
|
||||
}
|
||||
@@ -258,6 +263,8 @@ fn qwen_checkpoint_roundtrip_and_failed_restore_preserve_live_state() {
|
||||
.unwrap();
|
||||
let state = Some(State::Recurrent(vec![Some(leaf.clone()), None]));
|
||||
let mut live = LiveSession {
|
||||
current_images: Vec::new(),
|
||||
prefix_images: Vec::new(),
|
||||
current: Some(SessionSnapshot {
|
||||
token_ids: vec![1, 2, 3, 4],
|
||||
logits: leaf.clone(),
|
||||
|
||||
Reference in new issue
Block a user