Skip to content

Commit

Permalink
dev(narugo): optimize, ci skip
Browse files Browse the repository at this point in the history
  • Loading branch information
narugo1992 committed Aug 27, 2024
1 parent 034fbb8 commit 3117821
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion zoo/arknights.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@ def get_text_for_lang(lang):
return pd.DataFrame(rows)


_DOCTOR_NAME = {
'zh': '博士',
'kr': '박사',
'jp': 'ドクター',
'en': 'doctor',
}


def sync(lang):
repository = f'deepghs/arknights_voices_{lang}'
hf_fs = get_hf_fs()
Expand Down Expand Up @@ -160,6 +168,7 @@ def _download(item, dst_file):
sound = Sound.open(dst_filename)
rows.append({
**item,
'voice_text': item['voice_text'].replace('{@nickname}', _DOCTOR_NAME[lang]),
'time': sound.time,
'sample_rate': sound.sample_rate,
'frames': sound.samples,
Expand All @@ -180,13 +189,14 @@ def _download(item, dst_file):
tar_create_index_for_directory(upload_dir)

with open(os.path.join(upload_dir, 'README.md'), 'w') as f:
_ls = {'kr': 'ko', 'jp': 'ja'}
print('---', file=f)
print('license: other', file=f)
print('task_categories:', file=f)
print('- automatic-speech-recognition', file=f)
print('- audio-classification', file=f)
print('language:', file=f)
print(f'- {lang}', file=f)
print(f'- {_ls.get(lang, lang)}', file=f)
print('tags:', file=f)
print('- voice', file=f)
print('- anime', file=f)
Expand Down

0 comments on commit 3117821

Please sign in to comment.