-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Implemented fast processing of extract_embedding #356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
flake8 --max-line-length 150 --ignore B006,B008,B905,C408,E402,E741,W503,W504 --exclude ./third_party/,./runtime/python/grpc/cosyvoice_pb2*py
./cosyvoice/utils/scheduler.py:92:75: E231 missing whitespace after ','
./cosyvoice/utils/train_utils.py:133:9: F811 redefinition of unused 'scheduler' from line 127 I have a newer version of lintner, but I don't think that's a problem. |
yes, use multi thread can increase the throughput, but I don't think using queue is a good idea. you can use threadpool.map, this can make the code more clear. for example 、、、 |
The implementation of concurrent.futures looks not bad, I thought that onnx can't work in this way. |
tools/extract_embedding.py
Outdated
from tqdm import tqdm | ||
|
||
|
||
def extract_embedding(input_list): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
入参可以应该直接改为utt, wav
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
tools/extract_embedding.py
Outdated
)(audio) | ||
feat = kaldi.fbank(audio, num_mel_bins=80, dither=0, sample_frequency=16000) | ||
feat = feat - feat.mean(dim=0, keepdim=True) | ||
embedding = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不需要这么多换行,看我们workflow/lint.py,里面最大允许150长度,不然换行太多了也影响可读性
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
麻烦按意见修改一下,改为了merge到dev/lyuxiang.lx,我这边测过后再会和几个新的修改统一merge到main,谢谢 @MiXaiLL76 |
because we run this model on the processor. We can run parallel processing of the dataset.
In my experiment, I accelerated the preprocessing of the dataset from 2 hours to 30 minutes.
Moreover, we work with dicts, so it doesn't matter to us in what order the data is processed.