MCPcopy Create free account
hub / github.com/evilsocket/cake / load

Method load

cake-core/src/models/flux/flux1_model.rs:933–949  ·  view source on GitHub ↗
(name: String, ctx: &crate::cake::Context)

Source from the content-addressed store, hash-verified

931#[async_trait::async_trait]
932impl crate::cake::Forwarder for Flux1TransformerForwarder {
933 fn load(name: String, ctx: &crate::cake::Context) -> anyhow::Result<Box<Self>>
934 where
935 Self: Sized,
936 {
937 let dev = &ctx.device;
938 let cfg = Config::dev();
939 let vb = unsafe {
940 crate::utils::native_dtype_backend::load_native_dtype_var_builder(
941 std::slice::from_ref(&ctx.data_path),
942 DType::F32,
943 dev,
944 )?
945 };
946 let vb = vb.pp(super::config::flux1_prefixes::TRANSFORMER);
947 let model = Flux1Transformer::new(&cfg, vb, ctx.backend.clone())?;
948 Ok(Box::new(Self { model, name }))
949 }
950
951 async fn forward(
952 &self,

Callers

nothing calls this directly

Calls 2

cloneMethod · 0.45

Tested by

no test coverage detected