in src/api/sync.rs [1185:1269]
fn detailed_info() {
let tmp = TempDir::new();
let api = ApiBuilder::new()
.with_progress(false)
.with_token(None)
.with_cache_dir(tmp.path.clone())
.build()
.unwrap();
let repo = Repo::with_revision(
"mcpotato/42-eicar-street".to_string(),
RepoType::Model,
"8b3861f6931c4026b0cd22b38dbc09e7668983ac".to_string(),
);
let blobs_info: Value = api
.repo(repo)
.info_request()
.query("blobs", "true")
.call()
.unwrap()
.body_mut()
.read_json()
.unwrap();
assert_no_diff!(
blobs_info,
json!({
"_id": "621ffdc136468d709f17ddb4",
"author": "mcpotato",
"createdAt": "2022-03-02T23:29:05.000Z",
"disabled": false,
"downloads": 0,
"gated": false,
"id": "mcpotato/42-eicar-street",
"lastModified": "2022-11-30T19:54:16.000Z",
"likes": 3,
"modelId": "mcpotato/42-eicar-street",
"private": false,
"sha": "8b3861f6931c4026b0cd22b38dbc09e7668983ac",
"siblings": [
{
"blobId": "6d34772f5ca361021038b404fb913ec8dc0b1a5a",
"rfilename": ".gitattributes",
"size": 1175
},
{
"blobId": "be98037f7c542112c15a1d2fc7e2a2427e42cb50",
"rfilename": "build_pickles.py",
"size": 304
},
{
"blobId": "8acd02161fff53f9df9597e377e22b04bc34feff",
"rfilename": "danger.dat",
"size": 66
},
{
"blobId": "86b812515e075a1ae216e1239e615a1d9e0b316e",
"rfilename": "eicar_test_file",
"size": 70
},
{
"blobId": "86b812515e075a1ae216e1239e615a1d9e0b316e",
"rfilename": "eicar_test_file_bis",
"size":70
},
{
"blobId": "cd1c6d8bde5006076655711a49feae66f07d707e",
"lfs": {
"pointerSize": 127,
"sha256": "f9343d7d7ec5c3d8bcced056c438fc9f1d3819e9ca3d42418a40857050e10e20",
"size": 22
},
"rfilename": "pytorch_model.bin",
"size": 22
},
{
"blobId": "8ab39654695136173fee29cba0193f679dfbd652",
"rfilename": "supposedly_safe.pkl",
"size": 31
}
],
"spaces": [],
"tags": ["pytorch", "region:us"],
"usedStorage": 22
})
);
}