andfaa's picture
Create app.py
956b4e3 verified
raw
history blame contribute delete
677 Bytes
import gradio as gr
from transformers import pipeline
# Last inn norsk chatterbox-tts-modell
tts = pipeline(
"text-to-speech",
model="akhbar/chatterbox-tts-norwegian",
device="cpu"
)
def speak(text):
audio = tts(text)
return (16000, audio["audio"])
title = "Norsk Bokmål TTS – akhbar/chatterbox-tts-norwegian"
description = """
Denne demoen bruker Hugging Face-modellen **akhbar/chatterbox-tts-norwegian**
for å generere norsk bokmål tekst-til-tale.
"""
gr.Interface(
fn=speak,
inputs=gr.Textbox(label="Skriv tekst på norsk bokmål"),
outputs=gr.Audio(label="Generert tale"),
title=title,
description=description
).launch()