Spaces:
Runtime error
Runtime error
Commit
·
eb69374
1
Parent(s):
79be08a
fix: missing libs
Browse files- app.py +0 -28
- requirements.txt +3 -1
app.py
CHANGED
@@ -52,32 +52,4 @@ demo = gr.Interface(
|
|
52 |
"text",
|
53 |
)
|
54 |
|
55 |
-
# def transcribe(stream, new_chunk):
|
56 |
-
# sr, y = new_chunk
|
57 |
-
# y = y.astype(np.float32)
|
58 |
-
# y /= np.max(np.abs(y))
|
59 |
-
|
60 |
-
# if stream is not None:
|
61 |
-
# stream = np.concatenate([stream, y])
|
62 |
-
# else:
|
63 |
-
# stream = y
|
64 |
-
|
65 |
-
# text = transcriber({"sampling_rate": sr, "raw": stream})["text"]
|
66 |
-
# if text is not None:
|
67 |
-
# # pretty text
|
68 |
-
# tokens = word_tokenize(text, engine="attacut", join_broken_num=True)
|
69 |
-
# result = f'pretty: {thw.pretty(tokens)}\n\n original: {text}'
|
70 |
-
# else:
|
71 |
-
# result = 'โปรดลองพูดอีกครั้ง'
|
72 |
-
|
73 |
-
# return stream, result
|
74 |
-
|
75 |
-
|
76 |
-
# demo = gr.Interface(
|
77 |
-
# transcribe,
|
78 |
-
# ["state", gr.Audio(sources=["microphone"], streaming=True)],
|
79 |
-
# ["state", "text"],
|
80 |
-
# live=True,
|
81 |
-
# )
|
82 |
-
|
83 |
demo.launch()
|
|
|
52 |
"text",
|
53 |
)
|
54 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
demo.launch()
|
requirements.txt
CHANGED
@@ -1,3 +1,5 @@
|
|
1 |
transformers
|
2 |
torch
|
3 |
-
torchaudio
|
|
|
|
|
|
1 |
transformers
|
2 |
torch
|
3 |
+
torchaudio
|
4 |
+
pythainlp
|
5 |
+
attacut
|