(name: String, ctx: &crate::cake::Context)
| 931 | #[async_trait::async_trait] |
| 932 | impl 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, |
nothing calls this directly
no test coverage detected