@@ -91,7 +91,9 @@ struct InspectArgs {
9191#[ derive( Debug , Clone , Default , clap:: ValueEnum ) ]
9292pub enum Provider {
9393 #[ default]
94+ #[ value( alias = "hf" ) ]
9495 Huggingface ,
96+ #[ value( alias = "ms" ) ]
9597 Modelscope ,
9698}
9799
@@ -141,12 +143,12 @@ pub async fn run(cli: Cli) {
141143 "MODEL" , "TASK" , "PROVIDER" , "REVISION" , "SIZE" , "CREATED"
142144 ] ) ;
143145 for model in models {
144- let size_str = format_size_decimal ( model. metadata . artifact . size ) ;
146+ let size_str = format_size_decimal ( model. metadata . cache . size ) ;
145147
146- let revision_short = if model. metadata . artifact . revision . len ( ) > 8 {
147- & model. metadata . artifact . revision [ ..8 ]
148+ let revision_short = if model. metadata . cache . revision . len ( ) > 8 {
149+ & model. metadata . cache . revision [ ..8 ]
148150 } else {
149- & model. metadata . artifact . revision
151+ & model. metadata . cache . revision
150152 } ;
151153
152154 let created_str = format_time_ago ( & model. created_at ) ;
@@ -230,7 +232,7 @@ pub async fn run(cli: Cli) {
230232#[ cfg( test) ]
231233mod tests {
232234 use super :: * ;
233- use crate :: registry:: model_registry:: { ArtifactInfo , ModelInfo , ModelMetadata } ;
235+ use crate :: registry:: model_registry:: { CacheInfo , ModelInfo , ModelMetadata } ;
234236 use tempfile:: TempDir ;
235237
236238 // Helper to create a test model
@@ -245,15 +247,15 @@ mod tests {
245247 ModelInfo {
246248 uuid : revision. to_string ( ) ,
247249 name : name. to_string ( ) ,
250+ provider : "huggingface" . to_string ( ) ,
248251 author : Some ( "test-author" . to_string ( ) ) ,
249252 task : Some ( "text-generation" . to_string ( ) ) ,
250253 model_series : Some ( "gpt2" . to_string ( ) ) ,
251- provider : "huggingface" . to_string ( ) ,
252254 license : Some ( "mit" . to_string ( ) ) ,
253255 created_at : "2025-01-01T00:00:00Z" . to_string ( ) ,
254256 updated_at : "2025-01-01T00:00:00Z" . to_string ( ) ,
255257 metadata : ModelMetadata {
256- artifact : ArtifactInfo {
258+ cache : CacheInfo {
257259 revision : revision. to_string ( ) ,
258260 size : 1000 ,
259261 path : "/tmp/test" . to_string ( ) ,
@@ -375,7 +377,7 @@ mod tests {
375377
376378 // Update the model
377379 let mut updated_model = create_test_model ( "test/updated-model" , "v2" ) ;
378- updated_model. metadata . artifact . size = 2000 ;
380+ updated_model. metadata . cache . size = 2000 ;
379381 updated_model. created_at = "2025-01-05T00:00:00Z" . to_string ( ) ;
380382 updated_model. updated_at = "2025-01-05T00:00:00Z" . to_string ( ) ;
381383
@@ -387,7 +389,7 @@ mod tests {
387389 // updated_at should be new
388390 assert_eq ! ( result. updated_at, "2025-01-05T00:00:00Z" ) ;
389391 // Other fields should be updated
390- assert_eq ! ( result. metadata. artifact . revision, "v2" ) ;
391- assert_eq ! ( result. metadata. artifact . size, 2000 ) ;
392+ assert_eq ! ( result. metadata. cache . revision, "v2" ) ;
393+ assert_eq ! ( result. metadata. cache . size, 2000 ) ;
392394 }
393395}
0 commit comments