sHORTgpt / shortGPT /gpt /gpt_voice.py
wiydarrr's picture
Upload folder using huggingface_hub
5f685fd verified
raw
history blame contribute delete
378 Bytes
from shortGPT.gpt import gpt_utils
def getGenderFromText(text):
chat, system = gpt_utils.load_local_yaml_prompt('prompt_templates/voice_identify_gender.yaml')
chat = chat.replace("<<STORY>>", text)
result = gpt_utils.gpt3Turbo_completion(chat_prompt=chat, system=system).replace("\n", "").lower()
if 'female' in result:
return 'female'
return 'male'