Spaces:
Sleeping
Sleeping
File size: 634 Bytes
273cd6b 5fe24a7 712a04d 479acdd 712a04d 479acdd 712a04d 273cd6b 6882990 02aa159 6882990 273cd6b 6882990 273cd6b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
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"
api_key = os.environ.get("Id_mode_vits")
headers = {"Authorization": f"Bearer {api_key}"}
def query(text):
payload={"inputs": text}
response = requests.post(API_URL, headers=headers, 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() |