需补充更多信息
需补充更多信息
需补充更多信息
训练过程中使用了以下超参数:
| 训练损失 | 轮次 | 步数 | 验证损失 | 准确率 | F1 |
|---|---|---|---|---|---|
| 0.6405 | 0.53 | 5000 | 0.5826 | 0.7498 | 0.7498 |
| 0.5698 | 1.07 | 10000 | 0.5686 | 0.7612 | 0.7612 |
| 0.5286 | 1.6 | 15000 | 0.5593 | 0.7636 | 0.7636 |
| 0.5141 | 2.13 | 20000 | 0.5842 | 0.7648 | 0.7648 |
| 0.4763 | 2.67 | 25000 | 0.5736 | 0.7637 | 0.7637 |
| 0.4549 | 3.2 | 30000 | 0.6027 | 0.7593 | 0.7593 |
| 0.4231 | 3.73 | 35000 | 0.6017 | 0.7552 | 0.7552 |
| 0.3965 | 4.27 | 40000 | 0.6489 | 0.7551 | 0.7551 |
| 0.3744 | 4.8 | 45000 | 0.6426 | 0.7534 | 0.7534 |
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()