diff --git a/Cargo.toml b/Cargo.toml index 50db5e7..f5714e9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -39,7 +39,7 @@ natord = "1.0.9" tracing = "0.1.40" tracing-subscriber = "0.3.18" minifb = "0.27.0" -aksr = { git = "https://github.com/jamjamjon/aksr.git" } +aksr = "0.0.1" [features] diff --git a/src/ys/embedding.rs b/src/ys/embedding.rs index daaf63d..c6b554b 100644 --- a/src/ys/embedding.rs +++ b/src/ys/embedding.rs @@ -1,11 +1,12 @@ +use aksr::Builder; use anyhow::Result; use ndarray::{Array, Axis, Ix2, IxDyn}; use crate::X; /// Embedding for image or text. -#[derive(Clone, PartialEq, Default)] -pub struct Embedding(Array); +#[derive(Builder, Clone, PartialEq, Default)] +pub struct Embedding(#[args(alias = "embedding")] Array); impl std::fmt::Debug for Embedding { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { @@ -24,11 +25,6 @@ impl Embedding { Self(x) } - pub fn with_embedding(mut self, x: Array) -> Self { - self.0 = x; - self - } - pub fn data(&self) -> &Array { &self.0 }