Spaces:
Runtime error
Runtime error
import gradio as gr | |
import sys | |
import os | |
from gradio_client import Client | |
HF_TOKEN = os.getenv('HF_TOKEN') | |
examples=[ | |
["چۆنیەتیی خواردنی دەرمانی شەکرە لە مانگی رەمەزاندا"], | |
["ئێمباپێ هێشتا نەچووەتە ریال مەدرید کێشە بۆ ئاتلێتیکۆ مەدرید دروست دەکات"], | |
] | |
client = Client("Karzan/Barnammer-TTS",hf_token=HF_TOKEN) | |
def tts(text: str): | |
# synthesize | |
result = client.predict( | |
text=text, | |
api_name="/predict" | |
) | |
return result | |
iface = gr.Interface( | |
fn=tts, | |
inputs=[ | |
gr.Textbox( | |
label="Text", | |
value="خوێندنەوەی دەق بە دەنگی بەختیار", | |
), | |
], | |
outputs=gr.Audio(label="Output",type='filepath'), | |
examples=examples, | |
title="🗣️ Barnammer-TTS 🗣️", | |
live=False | |
) | |
iface.launch(share=False) |