ASG Models commited on
Commit
712a04d
·
verified ·
1 Parent(s): 5fe24a7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -5
app.py CHANGED
@@ -10,14 +10,18 @@ def reverse_audio(audio):
10
  return (sr, np.flipud(data))
11
 
12
  # Use a pipeline as a high-level helper
13
- from transformers import pipeline
 
 
 
 
 
 
 
14
 
15
- pipe = pipeline("text-to-speech", model="asg2024/vits-ar-sa")
16
- def inputText(text):
17
- return text
18
  demo = gr.Interface(
19
  fn=reverse_audio,
20
- inputs=pipe,
21
  outputs="audio"
22
  )
23
 
 
10
  return (sr, np.flipud(data))
11
 
12
  # Use a pipeline as a high-level helper
13
+ import requests
14
+
15
+ API_URL = "https://api-inference.huggingface.co/models/asg2024/vits-ar-sa"
16
+
17
+ def query(text):
18
+ payload={"inputs": text}
19
+ response = requests.post(API_URL, json=payload)
20
+ return response.content
21
 
 
 
 
22
  demo = gr.Interface(
23
  fn=reverse_audio,
24
+ inputs=query,
25
  outputs="audio"
26
  )
27