From eca8b01f140557d0f10fe46b030984e8cb86baf4 Mon Sep 17 00:00:00 2001 From: Michael Chung Date: Thu, 21 Dec 2023 00:42:22 -0500 Subject: [PATCH] Missed 1 file. --- .../remote_cloud_bucket_details.rs | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 crates/lib/api_clients/cloud_storage/src/remote_file_manager/remote_cloud_bucket_details.rs diff --git a/crates/lib/api_clients/cloud_storage/src/remote_file_manager/remote_cloud_bucket_details.rs b/crates/lib/api_clients/cloud_storage/src/remote_file_manager/remote_cloud_bucket_details.rs new file mode 100644 index 0000000000..39b9ada6b9 --- /dev/null +++ b/crates/lib/api_clients/cloud_storage/src/remote_file_manager/remote_cloud_bucket_details.rs @@ -0,0 +1,48 @@ + + +use super::file_descriptor::FileDescriptor; +use crate::remote_file_manager::weights_descriptor::{WeightsLoRADescriptor, WeightsSD15Descriptor, WeightsSDXLDescriptor, self}; + +pub struct RemoteCloudBucketDetails { + object_hash: String, + prefix: String, + suffix: String, +} + +impl RemoteCloudBucketDetails { + pub fn new(object_hash: String, prefix: String, suffix: String) -> Self { + Self { + object_hash: object_hash, + prefix: prefix, + suffix: suffix + } + } + pub fn get_object_hash(&self) -> &str { + &self.object_hash + } + pub fn get_prefix(&self) -> &str { + &self.prefix + } + pub fn get_suffix(&self) -> &str { + &self.suffix + } + + pub fn file_descriptor_from_bucket_details(&self) -> Box { + match self.prefix.as_str() { + "loRA" => Box::new(weights_descriptor::WeightsLoRADescriptor {}), + "SD15" => Box::new(weights_descriptor::WeightsSD15Descriptor {}), + "SDXL" => Box::new(weights_descriptor::WeightsSDXLDescriptor {}), + _ => panic!("Unknown prefix: {}", self.prefix) + } + } +} + + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + pub fn test() {} + +} \ No newline at end of file