Spaces:
Build error
Build error
Commit
·
a970913
1
Parent(s):
25c31ff
Update app.py
Browse files
app.py
CHANGED
|
@@ -48,11 +48,15 @@ def reformat_freq(sr, y):
|
|
| 48 |
sr = 16000
|
| 49 |
return sr, y
|
| 50 |
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
scorer_path = hf_hub_download(repo_id = REPO_ID, filename = "english/huge-vocabulary.scorer")
|
| 54 |
|
| 55 |
def stt_record(audio_record_buffer):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
_, y = reformat_freq(*audio_record_buffer)
|
| 57 |
scorer = True # use scorer
|
| 58 |
if scorer:
|
|
|
|
| 48 |
sr = 16000
|
| 49 |
return sr, y
|
| 50 |
|
| 51 |
+
|
| 52 |
+
|
|
|
|
| 53 |
|
| 54 |
def stt_record(audio_record_buffer):
|
| 55 |
+
#using english model, it is here to reduce memory usage, will trigger download first run
|
| 56 |
+
#unfortunately will be slow as it is shared cpu/memory need to free memory after run
|
| 57 |
+
acoustic_model = Model(hf_hub_download(repo_id = REPO_ID, filename = "english/model.tflite"))
|
| 58 |
+
scorer_path = hf_hub_download(repo_id = REPO_ID, filename = "english/huge-vocabulary.scorer")
|
| 59 |
+
|
| 60 |
_, y = reformat_freq(*audio_record_buffer)
|
| 61 |
scorer = True # use scorer
|
| 62 |
if scorer:
|