Struct rust_bert::resources::RemoteResource [−][src]
Expand description
Fields
url: StringRemote path/url for the resource
cache_subdir: StringLocal subdirectory of the cache root where this resource is saved
Implementations
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-&strLocation of the remote resourcecache_subdir-&strLocal subdirectory of the cache root to save the resource to
Returns
RemoteResourceRemoteResource object
Example
use rust_bert::resources::{RemoteResource, Resource};
let config_resource = Resource::Remote(RemoteResource::new(
"configs",
"http://config_json_location",
));Creates a new RemoteResource from an URL and local name. Will define a local path pointing to ~/.cache/.rustbert/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
RemoteResourceRemoteResource object
Example
use rust_bert::resources::{RemoteResource, Resource};
let model_resource = Resource::Remote(RemoteResource::from_pretrained((
"distilbert-sst2",
"https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english/resolve/main/rust_model.ot",
)));Trait Implementations
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
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
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
type Output = T
type Output = T
Should always be Self
