hf_mirrors/distilbert-base-multilingual-cased-sentiment
Model Introduction
Files & versions
Analysis
You are visiting the mirror address of https://modelers.cn/ChongqingAscend/distilbert-base-multilingual-cased-sentiment. The repo is synchronized in real-time and is only for mirror acceleration access.

distilbert-base-multilingual-cased-sentiment

Model description

More information needed

Intended uses & limitations

More information needed

Training and evaluation data

More information needed

Training procedure

Training hyperparameters

The following hyperparameters were used during training:

  • learning_rate: 5e-05
  • train_batch_size: 16
  • eval_batch_size: 16
  • seed: 33
  • distributed_type: sagemaker_data_parallel
  • num_devices: 8
  • total_train_batch_size: 128
  • total_eval_batch_size: 128
  • optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
  • lr_scheduler_type: linear
  • lr_scheduler_warmup_steps: 500
  • num_epochs: 5
  • mixed_precision_training: Native AMP

Training results

Training LossEpochStepValidation LossAccuracyF1
0.64050.5350000.58260.74980.7498
0.56981.07100000.56860.76120.7612
0.52861.6150000.55930.76360.7636
0.51412.13200000.58420.76480.7648
0.47632.67250000.57360.76370.7637
0.45493.2300000.60270.75930.7593
0.42313.73350000.60170.75520.7552
0.39654.27400000.64890.75510.7551
0.37444.8450000.64260.75340.7534

Framework versions

  • Transformers 4.12.3
  • Pytorch 1.9.1
  • Datasets 1.15.1
  • Tokenizers 0.10.3

How to use

from openmind import pipeline, AutoTokenizer, is_torch_npu_available
import argparse

def parse_args():
    parser = argparse.ArgumentParser()
    parser.add_argument(
        "--model_name_or_path",
        type=str,
        help="Path to model",
        default="ChongqingAscend/distilbert-base-multilingual-cased-sentiment",
    )
    args = parser.parse_args()
    return args

def main():
    args = parse_args()
    model_path = args.model_name_or_path

    if is_torch_npu_available():
        device = "npu:0"
    else:
        device = "cpu"

    #tokenizer = AutoTokenizer.from_pretrained(model_path)
    pipe = pipeline("token-classification", model=model_path, device=device)
    out = pipe("I love you")

    print(out)
    
if __name__ == "__main__":
    main()