From cb2c382f4d9419e3bd1aab9075f21d8a168a896a Mon Sep 17 00:00:00 2001 From: Takaaki-Saeki Date: Thu, 15 Feb 2024 19:19:54 +0900 Subject: [PATCH] Update the version from 1.0.0 to 1.0.1 --- discrete_speech_metrics/speechbertscore.py | 6 ++++++ discrete_speech_metrics/speechbleu.py | 6 ++++++ discrete_speech_metrics/speechtokendistance.py | 6 ++++++ setup.py | 2 +- 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/discrete_speech_metrics/speechbertscore.py b/discrete_speech_metrics/speechbertscore.py index c463152..27a1fc2 100644 --- a/discrete_speech_metrics/speechbertscore.py +++ b/discrete_speech_metrics/speechbertscore.py @@ -1,10 +1,16 @@ # Copyright 2024 Takaaki Saeki # MIT LICENSE (https://opensource.org/license/mit/) +import logging import torchaudio import torch from transformers import HubertModel, Wav2Vec2Model, WavLMModel +# In PyTorch 2+, a warning for checkpoint mismatch is raised. +# But it should be a false alarm according to the following issue. +# https://github.com/huggingface/transformers/issues/26796 +# I have added the following line to suppress the warning. +logging.getLogger("transformers").setLevel(logging.ERROR) def bert_score(v_generated, v_reference): """ diff --git a/discrete_speech_metrics/speechbleu.py b/discrete_speech_metrics/speechbleu.py index 77fd1d9..74d7ac1 100644 --- a/discrete_speech_metrics/speechbleu.py +++ b/discrete_speech_metrics/speechbleu.py @@ -1,6 +1,7 @@ # Copyright 2024 Takaaki Saeki # MIT LICENSE (https://opensource.org/license/mit/) +import logging from transformers import HubertModel import os import pathlib @@ -13,6 +14,11 @@ from nltk.translate.bleu_score import sentence_bleu nltk.download('punkt') +# In PyTorch 2+, a warning for checkpoint mismatch is raised. +# But it should be a false alarm according to the following issue. +# https://github.com/huggingface/transformers/issues/26796 +# I have added the following line to suppress the warning. +logging.getLogger("transformers").setLevel(logging.ERROR) def int_array_to_chinese_unicode(arr): """ diff --git a/discrete_speech_metrics/speechtokendistance.py b/discrete_speech_metrics/speechtokendistance.py index d76bbf5..1d7ec7a 100644 --- a/discrete_speech_metrics/speechtokendistance.py +++ b/discrete_speech_metrics/speechtokendistance.py @@ -1,6 +1,7 @@ # Copyright 2024 Takaaki Saeki # MIT LICENSE (https://opensource.org/license/mit/) +import logging from transformers import HubertModel import os import pathlib @@ -12,6 +13,11 @@ from Levenshtein import distance as levenshtein_distance import jellyfish +# In PyTorch 2+, a warning for checkpoint mismatch is raised. +# But it should be a false alarm according to the following issue. +# https://github.com/huggingface/transformers/issues/26796 +# I have added the following line to suppress the warning. +logging.getLogger("transformers").setLevel(logging.ERROR) def int_array_to_chinese_unicode(arr): """ diff --git a/setup.py b/setup.py index cb1e8f6..7679f1b 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='discrete-speech-metrics', - version='1.0.0', + version='1.0.1', packages=find_packages(), install_requires=[ 'numpy>=1.20.3',