SadeghKrmi / pertts-streamlit

Persian text-to-speech streamlit interface
https://tts.datacula.com/
Apache License 2.0
24 stars 3 forks source link

use this model as python app #6

Closed danialhedaiat closed 4 months ago

danialhedaiat commented 5 months ago

hi i am study in Azad Islamic university (Central Tehran Unit) i need to use this app in python for my university project , not with api or cli , i want to use it in my project , how can i do that ? an i don't have GPU to train from your dataset

btw , that was awesome to use Amir SoodBakhsh Voice

SadeghKrmi commented 5 months ago

Hi Danial, Are you going to use it to inference some text to audio, or you want to train/improve the model? if the later is valid, then you need a GPU, without GPU, single epoch would take days unfortunately.

danialhedaiat commented 5 months ago

i just want to unference some text to audio but i cant use api i need to run it im a simple python code , like use some pretrained model

SadeghKrmi commented 5 months ago

then you can easily follow below instruction:

https://github.com/SadeghKrmi/pertts-streamlit?tab=readme-ov-file#python

danialhedaiat commented 5 months ago

i see that, but i cant use that in my project and show it to my professor 😂 , i need some how to use a model in a python app and create web interface for that and use this modal for example fa_IR-amir-medium.onnx and send text to it with api and in return play a voice (something like what you do in this page https://tts.datacula.com/) or even with out web interface, simply just use

text = "درود بر جوجو عه بالای کوه"

and run it for example like this

python main.py

and if my professor ask me what did you do , i show some python code to him

my course is just Ai Lab and my Professor focus on me and he want to failed me, because he told us you have to create something commercial and publish it in bazar or somewhere like that and get +1000 downloads , and i told him i dont have time for that 1 month is not enough, in other way i dont want to work on Ai's. and he get mad at me (now i kinda like it but my lap top is old)

anyway please help me, Ai is not my stack im web backend developer not Ai developer, i need your help bro

danialhedaiat commented 5 months ago

hi i find a way

import wave

from piper import PiperVoice

model_path = "models/fa_IR-amir-medium.onnx"
config_path = "models/fa-fa_IR-amir-medium-fa_IR-amir-medium.onnx.json"

# Load voice
voice = PiperVoice.load(model_path, config_path=config_path)
synthesize_args = {

}

# Read entire input
text = "‌سلام و درود خدمت بچه های آز هوش، من دیگه نمیکشم آقا، من امیر سود بخش، راوی پادکست رخ، ۱۰ ساعت صدای من رو این دانشجو، استخراج کرده، دیتا کرده، اینو ساخته، دیگه بسته دیگه"

with wave.open("new.wav", "wb") as wav_file:
    voice.synthesize(text, wav_file)

it work for me thank you bro

SadeghKrmi commented 4 months ago

i see that, but i cant use that in my project and show it to my professor 😂 , i need some how to use a model in a python app and create web interface for that and use this modal for example fa_IR-amir-medium.onnx and send text to it with api and in return play a voice (something like what you do in this page https://tts.datacula.com/) or even with out web interface, simply just use

text = "درود بر جوجو عه بالای کوه"

and run it for example like this

python main.py

and if my professor ask me what did you do , i show some python code to him

my course is just Ai Lab and my Professor focus on me and he want to failed me, because he told us you have to create something commercial and publish it in bazar or somewhere like that and get +1000 downloads , and i told him i dont have time for that 1 month is not enough, in other way i dont want to work on Ai's. and he get mad at me (now i kinda like it but my lap top is old)

anyway please help me, Ai is not my stack im web backend developer not Ai developer, i need your help bro

من واقعا جا خوردم با این پیام شما، چرا باید کدی رو ارایه بدید که خودتون ننوشتید و بابتش مدرک/نمره بگیرید؟

danialhedaiat commented 4 months ago

چون یه درس یک واحدیه دانشگاه ازاده و استادش اصلا نه درس داده و نه خیلی سر کلاس اومده، و انتظار داره ۲ دو یا سه هفته من معجزه کنم و واقعا من وقتشو نداشتم چون ۲۶ واحد درس دارم این ترم، مدرکی نمیگرفتم ولی نمره چرا ، نمره رو گرفتم. و مشکل بعدیم نداشتن گرافیک و سیستم مناسب برای اینه که بخوام خودم مدل بسازم وگرنه واقعا این کار رو انجام نمیدادم باری به هر جهت دمش شما خیلیییی گرم

SadeghKrmi commented 4 months ago

واقعا متاسفم بابت این طرز تفکر شما!