wasm-speeker-sa / app.py
ASG Models
Update app.py
02aa159 verified
raw
history blame
526 Bytes
import os
import numpy as np
import gradio as gr
# Use a pipeline as a high-level helper
import requests
API_URL = "https://api-inference.huggingface.co/models/asg2024/vits-ar-sa"
def query(text):
payload={"inputs": text}
response = requests.post(API_URL, json=payload)
return response.content
def reverse_audio(text):
data = query(text)
return data#(16000, np.flipud(data))
demo = gr.Interface(
fn=reverse_audio,
inputs="text",
outputs="audio"
)
if __name__ == "__main__":
demo.launch()