import os voice_to_gender_dict = { "v2/en_speaker_0": "Male", "v2/en_speaker_1": "Male", "v2/en_speaker_2": "Male", "v2/en_speaker_3": "Male", "v2/en_speaker_4": "Male", "v2/en_speaker_5": "Male", "v2/en_speaker_6": "Male", "v2/en_speaker_7": "Male", "v2/en_speaker_8": "Male", "v2/en_speaker_9": "Female", "v2/zh_speaker_0": "Male", "v2/zh_speaker_1": "Male", "v2/zh_speaker_2": "Male", "v2/zh_speaker_3": "Male", "v2/zh_speaker_4": "Female", "v2/zh_speaker_5": "Male", "v2/zh_speaker_6": "Female", "v2/zh_speaker_7": "Female", "v2/zh_speaker_8": "Male", "v2/zh_speaker_9": "Female", "v2/fr_speaker_0": "Male", "v2/fr_speaker_1": "Female", "v2/fr_speaker_2": "Female", "v2/fr_speaker_3": "Male", "v2/fr_speaker_4": "Male", "v2/fr_speaker_5": "Female", "v2/fr_speaker_6": "Male", "v2/fr_speaker_7": "Male", "v2/fr_speaker_8": "Male", "v2/fr_speaker_9": "Male", "v2/de_speaker_0": "Male", "v2/de_speaker_1": "Male", "v2/de_speaker_2": "Male", "v2/de_speaker_3": "Female", "v2/de_speaker_4": "Male", "v2/de_speaker_5": "Male", "v2/de_speaker_6": "Male", "v2/de_speaker_7": "Male", "v2/de_speaker_8": "Female", "v2/de_speaker_9": "Male", "v2/hi_speaker_0": "Female", "v2/hi_speaker_1": "Female", "v2/hi_speaker_2": "Male", "v2/hi_speaker_3": "Female", "v2/hi_speaker_4": "Female", "v2/hi_speaker_5": "Male", "v2/hi_speaker_6": "Male", "v2/hi_speaker_7": "Male", "v2/hi_speaker_8": "Male", "v2/hi_speaker_9": "Female", "v2/it_speaker_0": "Male", "v2/it_speaker_1": "Male", "v2/it_speaker_2": "Female", "v2/it_speaker_3": "Male", "v2/it_speaker_4": "Male", "v2/it_speaker_5": "Male", "v2/it_speaker_6": "Male", "v2/it_speaker_7": "Female", "v2/it_speaker_8": "Male", "v2/it_speaker_9": "Female", "v2/ja_speaker_0": "Female", "v2/ja_speaker_1": "Female", "v2/ja_speaker_2": "Male", "v2/ja_speaker_3": "Female", "v2/ja_speaker_4": "Female", "v2/ja_speaker_5": "Female", "v2/ja_speaker_6": "Male", "v2/ja_speaker_7": "Female", "v2/ja_speaker_8": "Female", "v2/ja_speaker_9": "Female", "v2/ko_speaker_0": "Female", "v2/ko_speaker_1": "Male", "v2/ko_speaker_2": "Male", "v2/ko_speaker_3": "Male", "v2/ko_speaker_4": "Male", "v2/ko_speaker_5": "Male", "v2/ko_speaker_6": "Male", "v2/ko_speaker_7": "Male", "v2/ko_speaker_8": "Male", "v2/ko_speaker_9": "Male", "v2/pl_speaker_0": "Male", "v2/pl_speaker_1": "Male", "v2/pl_speaker_2": "Male", "v2/pl_speaker_3": "Male", "v2/pl_speaker_4": "Female", "v2/pl_speaker_5": "Male", "v2/pl_speaker_6": "Female", "v2/pl_speaker_7": "Male", "v2/pl_speaker_8": "Male", "v2/pl_speaker_9": "Female", "v2/pt_speaker_0": "Male", "v2/pt_speaker_1": "Male", "v2/pt_speaker_2": "Male", "v2/pt_speaker_3": "Male", "v2/pt_speaker_4": "Male", "v2/pt_speaker_5": "Male", "v2/pt_speaker_6": "Male", "v2/pt_speaker_7": "Male", "v2/pt_speaker_8": "Male", "v2/pt_speaker_9": "Male", "v2/ru_speaker_0": "Male", "v2/ru_speaker_1": "Male", "v2/ru_speaker_2": "Male", "v2/ru_speaker_3": "Male", "v2/ru_speaker_4": "Male", "v2/ru_speaker_5": "Female", "v2/ru_speaker_6": "Female", "v2/ru_speaker_7": "Male", "v2/ru_speaker_8": "Male", "v2/ru_speaker_9": "Female", "v2/es_speaker_0": "Male", "v2/es_speaker_1": "Male", "v2/es_speaker_2": "Male", "v2/es_speaker_3": "Male", "v2/es_speaker_4": "Male", "v2/es_speaker_5": "Male", "v2/es_speaker_6": "Male", "v2/es_speaker_7": "Male", "v2/es_speaker_8": "Female", "v2/es_speaker_9": "Female", "v2/tr_speaker_0": "Male", "v2/tr_speaker_1": "Male", "v2/tr_speaker_2": "Male", "v2/tr_speaker_3": "Male", "v2/tr_speaker_4": "Female", "v2/tr_speaker_5": "Female", "v2/tr_speaker_6": "Male", "v2/tr_speaker_7": "Male", "v2/tr_speaker_8": "Male", "v2/tr_speaker_9": "Male", } def get_speaker_gender(history_prompt: str): return voice_to_gender_dict.get(history_prompt.replace(os.path.sep, "/"), "Unknown")