Remove warnings and add some warnings (#1408)
This commit is contained in:
@@ -4,6 +4,7 @@ import librosa
|
||||
import torch
|
||||
import torch.nn.functional as F
|
||||
import soundfile as sf
|
||||
import os
|
||||
from transformers import logging as tf_logging
|
||||
tf_logging.set_verbosity_error()
|
||||
|
||||
@@ -24,9 +25,11 @@ cnhubert_base_path = None
|
||||
class CNHubert(nn.Module):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.model = HubertModel.from_pretrained(cnhubert_base_path)
|
||||
if os.path.exists(cnhubert_base_path):...
|
||||
else:raise FileNotFoundError(cnhubert_base_path)
|
||||
self.model = HubertModel.from_pretrained(cnhubert_base_path, local_files_only=True)
|
||||
self.feature_extractor = Wav2Vec2FeatureExtractor.from_pretrained(
|
||||
cnhubert_base_path
|
||||
cnhubert_base_path, local_files_only=True
|
||||
)
|
||||
|
||||
def forward(self, x):
|
||||
|
||||
Reference in New Issue
Block a user