Skip to content

Commit

Permalink
fix imports (modelscope#1748)
Browse files Browse the repository at this point in the history
  • Loading branch information
tastelikefeet committed Aug 19, 2024
1 parent e457716 commit c45ba2b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions swift/utils/metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
from typing import Dict, Literal

import numpy as np
from nltk.translate.bleu_score import SmoothingFunction, sentence_bleu
from rouge.rouge import Rouge
from torch import Tensor
from transformers.trainer_utils import EvalPrediction

Expand All @@ -15,6 +13,8 @@

def compute_nlg_metrics(prediction, tokenizer):
import jieba
from nltk.translate.bleu_score import SmoothingFunction, sentence_bleu
from rouge.rouge import Rouge
preds, labels = prediction[0], prediction[1]

score_dict = {'rouge-1': [], 'rouge-2': [], 'rouge-l': [], 'bleu-4': []}
Expand Down

0 comments on commit c45ba2b

Please sign in to comment.