Formatting and dependencies update

This commit is contained in:
Guillaume B 2020-08-24 18:49:48 +02:00
parent 26320ae1d4
commit a5f8b9f37f
5 changed files with 10 additions and 8 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "rust-bert"
version = "0.7.12"
version = "0.8.0"
authors = ["Guillaume Becquin <guillaume.becquin@gmail.com>"]
edition = "2018"
description = "Ready-to-use NLP pipelines and transformer-based models (BERT, DistilBERT, GPT2,...)"
@ -30,8 +30,8 @@ all-tests = []
features = ["doc-only"]
[dependencies]
rust_tokenizers = { version = "~4.0.0", path = "E:/Coding/backup-rust/rust-tokenizers/main" }
tch = {version = "~0.2.0", path = "E:/Coding/tch-rs"}
rust_tokenizers = "~4.0.0"
tch = "~0.2.0"
serde_json = "1.0.56"
serde = { version = "1.0.114", features = ["derive"] }
dirs = "3.0.1"

View File

@ -1,8 +1,8 @@
pub(crate) mod activations;
pub mod config;
pub(crate) mod dropout;
pub mod error;
pub(crate) mod linear;
pub mod resources;
pub mod error;
pub use config::Config;

View File

@ -44,6 +44,7 @@
//! # Disclaimer
//! The authors of this repository are not responsible for any generation
//! from the 3rd party utilization of the pretrained system.
use crate::common::error::RustBertError;
use crate::common::resources::{RemoteResource, Resource};
use crate::gpt2::{
Gpt2ConfigResources, Gpt2MergesResources, Gpt2ModelResources, Gpt2VocabResources,
@ -55,7 +56,6 @@ use rust_tokenizers::Tokenizer;
use std::collections::HashMap;
use tch::{Device, Tensor};
use uuid::Uuid;
use crate::common::error::RustBertError;
/// # Configuration for multi-turn classification
/// Contains information regarding the model to load, mirrors the GenerationConfig, with a
@ -591,7 +591,9 @@ impl ConversationModel {
/// # Ok(())
/// # }
/// ```
pub fn new(conversation_config: ConversationConfig) -> Result<ConversationModel, RustBertError> {
pub fn new(
conversation_config: ConversationConfig,
) -> Result<ConversationModel, RustBertError> {
let generate_config = GenerateConfig {
model_resource: conversation_config.model_resource,
config_resource: conversation_config.config_resource,

View File

@ -117,8 +117,8 @@
//! Spanish| XLM_ROBERTA_NER_ES |
//! Dutch| XLM_ROBERTA_NER_NL |
use crate::pipelines::token_classification::{TokenClassificationConfig, TokenClassificationModel};
use crate::common::error::RustBertError;
use crate::pipelines::token_classification::{TokenClassificationConfig, TokenClassificationModel};
#[derive(Debug)]
/// # Entity generated by a `NERModel`

View File

@ -54,6 +54,7 @@
//! # ;
//! ```
use crate::common::error::RustBertError;
use crate::pipelines::sequence_classification::{
SequenceClassificationConfig, SequenceClassificationModel,
};
@ -61,7 +62,6 @@ use serde::Deserialize;
use std::error::Error;
use std::fs;
use std::path::PathBuf;
use crate::common::error::RustBertError;
#[derive(Debug, PartialEq)]
/// Enum with the possible sentiment polarities. Note that the pre-trained SST2 model does not include neutral sentiment.