Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -18,12 +18,14 @@ speaker_embeddings = {
|
|
| 18 |
"SLT": "spkemb/cmu_us_slt_arctic-wav-arctic_a0508.npy",
|
| 19 |
}
|
| 20 |
|
|
|
|
|
|
|
| 21 |
|
| 22 |
def predict(text, speaker):
|
| 23 |
if len(text.strip()) == 0:
|
| 24 |
return (16000, np.zeros(0).astype(np.int16))
|
| 25 |
|
| 26 |
-
inputs = processor(text=
|
| 27 |
|
| 28 |
# limit input length
|
| 29 |
input_ids = inputs["input_ids"]
|
|
|
|
| 18 |
"SLT": "spkemb/cmu_us_slt_arctic-wav-arctic_a0508.npy",
|
| 19 |
}
|
| 20 |
|
| 21 |
+
def getNews ():
|
| 22 |
+
return requests.get ("https://newsapi.org/v2/top-headlines?country=us&apiKey=3bca07c913ec4703a23f6ba03e15b30b").content
|
| 23 |
|
| 24 |
def predict(text, speaker):
|
| 25 |
if len(text.strip()) == 0:
|
| 26 |
return (16000, np.zeros(0).astype(np.int16))
|
| 27 |
|
| 28 |
+
inputs = processor(text=getNews(), return_tensors="pt")
|
| 29 |
|
| 30 |
# limit input length
|
| 31 |
input_ids = inputs["input_ids"]
|