Build a minimal Topology for a single worker from assigned layers.
(
worker_name: &str,
address: &str,
layers: &[String],
)
| 709 | |
| 710 | /// Build a minimal Topology for a single worker from assigned layers. |
| 711 | fn build_worker_topology( |
| 712 | worker_name: &str, |
| 713 | address: &str, |
| 714 | layers: &[String], |
| 715 | ) -> cake::Topology { |
| 716 | let mut topology = cake::Topology::new(); |
| 717 | topology.insert( |
| 718 | worker_name.to_string(), |
| 719 | cake::Node { |
| 720 | host: address.to_string(), |
| 721 | description: None, |
| 722 | layers: layers.to_vec(), |
| 723 | vram_bytes: 0, |
| 724 | tflops: 0.0, |
| 725 | backend: String::new(), |
| 726 | hostname: String::new(), |
| 727 | os: String::new(), |
| 728 | }, |
| 729 | ); |
| 730 | topology |
| 731 | } |
| 732 | |
| 733 | /// Return the base cache directory for zero-config model data. |
| 734 | fn cache_base_dir() -> PathBuf { |