Comments (7)
不太清楚你的情况,你要使用我的项目微调的话,要看文档,生成我项目所需要的数据格式。
from whisper-finetune.
@ILG2021 要改数据前处理的代码:
utils/data_utils.py:47:
input_features = [{"input_features": feature["input_features"][0]} for feature in features]
改成:
input_features = [{"input_features": feature["input_features"]} for feature in features]
from whisper-finetune.
你是改了什么吗?通道数都不对了
from whisper-finetune.
@dataclass
class AudioFolderDataset:
processor: Any
def _prepare_dataset(self, batch):
# load and resample audio data from 48 to 16kHz
audio = batch["audio"]
# compute log-Mel input features from input audio array
batch["input_features"] = \
self.processor.feature_extractor(audio["array"], sampling_rate=audio["sampling_rate"]).input_features[0]
# encode target text to label ids
batch["labels"] = self.processor.tokenizer(batch["sentence"]).input_ids
return batch
def load(self):
common_voice = load_dataset("audiofolder", data_dir="dataset")
common_voice = common_voice.cast_column("audio", Audio(sampling_rate=16000))
common_voice = common_voice.map(self._prepare_dataset, num_proc=1)
return common_voice['train'], common_voice['test']
train_dataset, test_dataset = AudioFolderDataset(processor=processor).load()
使用上面的dataset出现的
from whisper-finetune.
如果把per_device_train_batch_size设置为80,上面没错误提示了。但是会有另外的错误:
File "/opt/conda/lib/python3.10/site-packages/transformers/models/whisper/modeling_whisper.py", line 1486, in forward
outputs = self.model(
File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/opt/conda/lib/python3.10/site-packages/transformers/models/whisper/modeling_whisper.py", line 1346, in forward
encoder_outputs = self.encoder(
File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/opt/conda/lib/python3.10/site-packages/transformers/models/whisper/modeling_whisper.py", line 899, in forward
inputs_embeds = inputs_embeds.permute(0, 2, 1)
RuntimeError: permute(sparse_coo): number of dimensions in the tensor input does not match the length of the desired ordering of dimensions i.e. input.dim() = 2 is not equal to len(dims) = 3
from whisper-finetune.
from whisper-finetune.
数据集是标准的方法,一直使用在全参数下微调。另外按照如下lora方法微调也是可以的:
https://github.com/Vaibhavs10/fast-whisper-finetuning
from whisper-finetune.
Related Issues (20)
- [CONTRIBUTION] Speech dataset Generator
- 模型微调后出现乱码 HOT 1
- 训练到eval值的步数时报错:AttributeError: 'NoneType' object has no attribute 'get' HOT 1
- 请问如何导出onnx HOT 1
- 能結合 pyannote 嗎? HOT 1
- 微调模型保存时需要连接huggingface HOT 1
- transcribe时如何产生时间戳? HOT 2
- 能提供fine-tune 模型的原始 checkpoint (pt) 吗? HOT 1
- ubuntu20.04环境问题 HOT 8
- 使用large-v2-finetune,高機率出現重複內容… HOT 2
- 训练出的模型如何导出npz格式 HOT 1
- 如何导出pt格式的模型? HOT 1
- NaN or Inf found in input tensor HOT 2
- 建議您整理一下 requirements.txt 及 readme.md HOT 1
- 微调方言,数据标注为chinese还是新建一个方言的类型呢? HOT 1
- Belle-whisper-large-v3-zh 没法输出标点符号
- 是否支持mp4 视频
- tools/create_wenetspeech_data.py报错
- whisper全量微调相关问题
- finetune whisper-large-v3 的时候,中间模型解码会出现乱码和token多次重复的情况
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from whisper-finetune.