Spaces:
Paused
Paused
| import gradio as gr | |
| from transformers import AutoModel, AutoTokenizer | |
| import torch | |
| model = AutoModel.from_pretrained("shethjenil/vits_rasa_13", trust_remote_code=True).eval() | |
| tokenizer = AutoTokenizer.from_pretrained("shethjenil/vits_rasa_13") | |
| def fn(text,speaker_id,style_id): | |
| return 24000,model(torch.tensor([i if i else 0 for i in tokenizer.convert_tokens_to_ids(tokenizer.tokenize(text))]).unsqueeze(0), speaker_id=speaker_id, emotion_id=style_id).waveform.squeeze().numpy() | |
| gr.Interface(fn,[gr.TextArea("कैसे हो बाबू भैया हम तो बहुत उदास है"),gr.Dropdown(['Assamese-Female', 'Assamese-Male', 'Bengali-Female', 'Bengali-Male', 'Bodo-Female', 'Bodo-Male', 'Dogri-Female', 'Dogri-Male', 'Kannada-Female', 'Kannada-Male', 'Maithili-Male', 'Malayalam-Female', 'Marathi-Female', 'Marathi-Male', 'Nepali-Female', 'Punjabi-Female', 'Punjabi-Male', 'Sanskrit-Male', 'Tamil-Female', 'Telugu-Female'],type='index'),gr.Dropdown(['ALEXA', 'ANGER', 'BB', 'BOOK', 'CONV', 'DIGI', 'DISGUST', 'FEAR', 'HAPPY', 'NEWS', 'SAD', 'SURPRISE', 'UMANG', 'WIKI'],type='index')],gr.Audio()).launch() | |