[−][src]Struct rust_bert::resources::RemoteResource
Fields
url: String
Remote path/url for the resource
cache_subdir: String
Local subdirectory of the cache root where this resource is saved
Implementations
impl RemoteResource
[src]
pub fn new(url: &str, cache_subdir: &str) -> RemoteResource
[src]
Creates a new RemoteResource from an URL and a custom local path. Note that this does not download the resource (only declares the remote and local locations)
Arguments
url
-&str
Location of the remote resourcecache_subdir
-&str
Local subdirectory of the cache root to save the resource to
Returns
RemoteResource
RemoteResource object
Example
use rust_bert::resources::{RemoteResource, Resource}; let config_resource = Resource::Remote(RemoteResource::new( "configs", "http://config_json_location", ));
pub fn from_pretrained(name_url_tuple: (&str, &str)) -> RemoteResource
[src]
Creates a new RemoteResource from an URL and local name. Will define a local path pointing to ~/.cache/.rusbert/model_name. Note that this does not download the resource (only declares the remote and local locations)
Arguments
name_url_tuple
-(&str, &str)
Location of the name of model and remote resource
Returns
RemoteResource
RemoteResource object
Example
use rust_bert::resources::{RemoteResource, Resource}; let model_resource = Resource::Remote(RemoteResource::from_pretrained(( "distilbert-sst2", "https://cdn.huggingface.co/distilbert-base-uncased-finetuned-sst-2-english-rust_model.ot", )));
Trait Implementations
impl Clone for RemoteResource
[src]
fn clone(&self) -> RemoteResource
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl PartialEq<RemoteResource> for RemoteResource
[src]
fn eq(&self, other: &RemoteResource) -> bool
[src]
fn ne(&self, other: &RemoteResource) -> bool
[src]
impl StructuralPartialEq for RemoteResource
[src]
Auto Trait Implementations
impl RefUnwindSafe for RemoteResource
impl Send for RemoteResource
impl Sync for RemoteResource
impl Unpin for RemoteResource
impl UnwindSafe for RemoteResource
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,