[−][src]Struct rust_bert::resources::RemoteResource
Fields
url: String
Remote path/url for the resource
local_path: PathBuf
Local path for the resource
Methods
impl RemoteResource
[src]
pub fn new(url: &str, target: PathBuf) -> 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 resourcetarget
-PathBuf
Local path to save teh resource to
Returns
RemoteResource
RemoteResource object
Example
use rust_bert::resources::{Resource, RemoteResource}; use std::path::PathBuf; let config_resource = Resource::Remote(RemoteResource::new("http://config_json_location", PathBuf::from("path/to/config.json")));
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::{Resource, RemoteResource}; let model_resource = Resource::Remote(RemoteResource::from_pretrained( ("distilbert-sst2/model.ot", "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> 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>,