For inference with gradio

pip install gradio
#import spaces
import gradio as gr
import outetts
import torch
from outetts.interface import InterfaceHF
from outetts.models.config import GenerationConfig
TOKENIZERS_PARALLELISM=False

model_config = outetts.ModelConfig(
            model_path="Karayakar/Oute-TTS",
            tokenizer_path="Karayakar/Oute-TTS",
            interface_version=outetts.InterfaceVersion.V2,
            backend=outetts.Backend.HF,
            quantization=outetts.LlamaCppQuantization.FP16,
            device="cuda",
            dtype=torch.bfloat16,
             
            )
interface = outetts.Interface(config=model_config)

#@spaces.GPU()
def generate_tts(textinput):
    gen_cfg = GenerationConfig(
        text=textinput,
        speaker= None 
    )
    output = interface.generate(config=gen_cfg)
    output.save("output.wav")
    return "output.wav"

with gr.Blocks() as demo:
    gr.Markdown(f"""
    # 🎵 OuteTTS-0.3-500M Turkish-TTS -  [Karay Akar](https://www.linkedin.com/in/karayakar/)
    Aşağıya metninizi girin ve OuteTTS modeliyle doğal sesli konuşmaya dönüştürülmesini dinleyin.
     
    """)    
    with gr.Row():
        with gr.Column():
            text_input = gr.Textbox(label="Text to Synthesize", placeholder="Enter text here...")
              
            submit_button = gr.Button("Generate Speech")
        with gr.Column():
            audio_output = gr.Audio(label="Generated Audio", type="filepath")

    submit_button.click(
        fn=generate_tts,
        inputs=[text_input],
        outputs=audio_output
    )

if __name__ == "__main__":
    demo.queue().launch(share=False, ssr_mode=False)
Downloads last month
27
Safetensors
Model size
499M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Karayakar/Oute-TTS-500M

Finetuned
(1)
this model

Space using Karayakar/Oute-TTS-500M 1