Update handler.py
Browse files- handler.py +2 -1
handler.py
CHANGED
|
@@ -5,6 +5,7 @@ import soundfile as sf
|
|
| 5 |
import torch
|
| 6 |
import io
|
| 7 |
import os
|
|
|
|
| 8 |
|
| 9 |
class EndpointHandler():
|
| 10 |
def __init__(self, model_dir: str):
|
|
@@ -40,5 +41,5 @@ class EndpointHandler():
|
|
| 40 |
pass
|
| 41 |
|
| 42 |
return {
|
| 43 |
-
"audio": buffer.read()
|
| 44 |
}
|
|
|
|
| 5 |
import torch
|
| 6 |
import io
|
| 7 |
import os
|
| 8 |
+
import base64
|
| 9 |
|
| 10 |
class EndpointHandler():
|
| 11 |
def __init__(self, model_dir: str):
|
|
|
|
| 41 |
pass
|
| 42 |
|
| 43 |
return {
|
| 44 |
+
"audio": base64.b64encode(buffer.read()).decode('utf-8')
|
| 45 |
}
|