Spaces:
Sleeping
Sleeping
File size: 661 Bytes
6a81069 dac6347 8d444a7 6a81069 dac6347 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
import gradio as gr
from transformers import pipeline
# Hugging Face์์ TTS ํ์ดํ๋ผ์ธ ๋ก๋
tts = pipeline("text-to-speech", model="tts-model-name") # ์ ํฉํ ๋ถ๊ฐ๋ฆฌ์์ด TTS ๋ชจ๋ธ ์ด๋ฆ์ผ๋ก ๋์ฒด
def generate_audio(text):
audio = tts(text)
return audio["audio"]
# Gradio ์ธํฐํ์ด์ค ์์ฑ
interface = gr.Interface(
fn=generate_audio,
inputs=gr.Textbox(lines=5, label="๋ถ๊ฐ๋ฆฌ์์ด ํ
์คํธ ์
๋ ฅ"),
outputs=gr.Audio(label="์์ฑ๋ ์์ฑ"),
title="๋ถ๊ฐ๋ฆฌ์์ด TTS",
description="๋ถ๊ฐ๋ฆฌ์์ด ํ
์คํธ๋ฅผ ์
๋ ฅํ๋ฉด ์์ฑ์ผ๋ก ๋ณํํฉ๋๋ค."
)
# ์น ์ฑ ์คํ
interface.launch()
|