Skip to content

Conversation

MiXaiLL76
Copy link
Contributor

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.

@MiXaiLL76
Copy link
Contributor Author

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.

@aluminumbox
Copy link
Collaborator

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

、、、
with Pool(processes=num_workers) as pool:
predictions = pool.map(single_job, tasks)
、、、

@MiXaiLL76
Copy link
Contributor Author

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

、、、 with Pool(processes=num_workers) as pool: predictions = pool.map(single_job, tasks) 、、、

The implementation of concurrent.futures looks not bad, I thought that onnx can't work in this way.

@aluminumbox aluminumbox changed the base branch from main to dev/lyuxiang.lx September 6, 2024 08:25
from tqdm import tqdm


def extract_embedding(input_list):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

入参可以应该直接改为utt, wav

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

)(audio)
feat = kaldi.fbank(audio, num_mel_bins=80, dither=0, sample_frequency=16000)
feat = feat - feat.mean(dim=0, keepdim=True)
embedding = (
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不需要这么多换行,看我们workflow/lint.py,里面最大允许150长度,不然换行太多了也影响可读性

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@aluminumbox
Copy link
Collaborator

麻烦按意见修改一下,改为了merge到dev/lyuxiang.lx,我这边测过后再会和几个新的修改统一merge到main,谢谢 @MiXaiLL76

@aluminumbox aluminumbox merged commit 2665b06 into FunAudioLLM:dev/lyuxiang.lx Sep 18, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants