Add bounded commit-pinned Hugging Face source streaming
This commit is contained in:
parent
0ad79c597f
commit
e13c01441c
1 changed files with 3595 additions and 26 deletions
24
crates/remora-hf-source/src/lib.rs
Normal file
24
crates/remora-hf-source/src/lib.rs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
mod body;
|
||||
mod error;
|
||||
mod sort;
|
||||
mod source;
|
||||
mod types;
|
||||
|
||||
pub use body::HfSourceBody;
|
||||
pub use error::HfSourceError;
|
||||
pub use source::{HfInventory, HfSource};
|
||||
pub use types::{
|
||||
HfInventoryDescriptor, HfMember, HfMemberStorage, HfRepoType, HfSelection, HfSnapshotIdentity,
|
||||
HfSourceRequest,
|
||||
};
|
||||
|
||||
fn digest_hex(bytes: impl AsRef<[u8]>) -> String {
|
||||
const DIGITS: &[u8; 16] = b"0123456789abcdef";
|
||||
let bytes = bytes.as_ref();
|
||||
let mut encoded = String::with_capacity(bytes.len() * 2);
|
||||
for &byte in bytes {
|
||||
encoded.push(DIGITS[(byte >> 4) as usize] as char);
|
||||
encoded.push(DIGITS[(byte & 0x0f) as usize] as char);
|
||||
}
|
||||
encoded
|
||||
}
|
||||
Loading…
Reference in a new issue