pub enum Source {
Bundled,
Ours {
repo: &'static str,
rev: &'static str,
},
Upstream {
repo: &'static str,
license: &'static str,
rev: &'static str,
},
Mirrored {
ours: &'static str,
upstream: &'static str,
license: &'static str,
rev: &'static str,
},
}Expand description
Where a set of weights comes from, and what we are permitted to do with it.
An earlier version of this enum forbade mirroring third-party weights on principle. That was the wrong rule: every model this engine uses turns out to be permissively licensed (Apache-2.0 or MIT), so mirroring is allowed. The obligations that do bind are attribution, carrying the licence text, and stating modifications — none of which is satisfied by simply refusing to host a copy.
The more important protection is the pinned revision. A mirror without a pin still drifts when we refresh it; a pin without a mirror still breaks when upstream deletes the repo. Both, where permitted.
Variants§
Bundled
Compiled into this crate. Small, ours, offline by construction.
Ours
Trained by this project and published to our own model repository.
Upstream
Someone else’s weights, fetched from the repository that published them.
Mirrored
Someone else’s weights that we also host, as the licence permits, so a build does not depend on an
upstream repository staying where it is. upstream is retained because attribution does not transfer.
Implementations§
Source§impl Source
impl Source
Sourcepub fn license(&self) -> Option<&'static str>
pub fn license(&self) -> Option<&'static str>
The licence a redistribution must carry, if this is not our own work.
Sourcepub fn attribution(&self) -> Option<&'static str>
pub fn attribution(&self) -> Option<&'static str>
Who to credit.
Sourcepub fn revision(&self) -> &'static str
pub fn revision(&self) -> &'static str
The revision this build expects. Pinning is what makes a fetch reproducible.
Sourcepub fn fetch_repo(&self) -> Option<&'static str>
pub fn fetch_repo(&self) -> Option<&'static str>
Where to fetch from, preferring our mirror when one exists.
Trait Implementations§
impl Copy for Source
impl StructuralPartialEq for Source
Auto Trait Implementations§
impl Freeze for Source
impl RefUnwindSafe for Source
impl Send for Source
impl Sync for Source
impl Unpin for Source
impl UnsafeUnpin for Source
impl UnwindSafe for Source
Blanket Implementations§
impl<T> Boilerplate for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more