Spaces:
Runtime error
Runtime error
demomodels
commited on
Commit
•
2a0eff5
1
Parent(s):
99cb23d
Initial commit
Browse files
app.py
CHANGED
@@ -31,16 +31,16 @@ pipe = pipeline(
|
|
31 |
)
|
32 |
|
33 |
def process(audio):
|
34 |
-
return audio
|
35 |
-
|
36 |
# y = y.astype(np.float32)
|
37 |
# y /= np.max(np.abs(y))
|
38 |
-
|
39 |
-
#
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
|
45 |
|
46 |
iface = gr.Interface(fn=process, inputs="audio", outputs="text")
|
|
|
31 |
)
|
32 |
|
33 |
def process(audio):
|
34 |
+
# return audio
|
35 |
+
sr, y = audio
|
36 |
# y = y.astype(np.float32)
|
37 |
# y /= np.max(np.abs(y))
|
38 |
+
|
39 |
+
# return transcriber({"sampling_rate": sr, "raw": y})["text"]
|
40 |
+
result = pipe({"sampling_rate": sr, "raw": y})['chunks']
|
41 |
+
for item in result:
|
42 |
+
item['timestamp'] = list(item['timestamp'])
|
43 |
+
return json.dumps(result)
|
44 |
|
45 |
|
46 |
iface = gr.Interface(fn=process, inputs="audio", outputs="text")
|