csukuangfj commited on
Commit
5decad3
1 Parent(s): ccb04a3

small fixes

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -40,9 +40,11 @@ def convert_to_wav(in_filename: str) -> str:
40
  out_filename = in_filename + ".wav"
41
  logging.info(f"Converting '{in_filename}' to '{out_filename}'")
42
  _ = os.system(f"ffmpeg -hide_banner -i '{in_filename}' -ar 16000 '{out_filename}'")
43
- _ = os.system(f"ffmpeg -hide_banner -loglevel error -i '{in_filename}' -ar 16000 '{out_filename}.flac'")
 
 
44
 
45
- with open(out_filename+".flac", "rb") as f:
46
  s = "\n" + out_filename + "\n"
47
  s += base64.b64encode(f.read()).decode()
48
  logging.info(s)
@@ -181,6 +183,10 @@ title = "# Automatic Speech Recognition with Next-gen Kaldi"
181
  description = """
182
  This space shows how to do automatic speech recognition with Next-gen Kaldi.
183
 
 
 
 
 
184
  It is running on CPU within a docker container provided by Hugging Face.
185
 
186
  See more information by visiting the following links:
 
40
  out_filename = in_filename + ".wav"
41
  logging.info(f"Converting '{in_filename}' to '{out_filename}'")
42
  _ = os.system(f"ffmpeg -hide_banner -i '{in_filename}' -ar 16000 '{out_filename}'")
43
+ _ = os.system(
44
+ f"ffmpeg -hide_banner -loglevel error -i '{in_filename}' -ar 16000 '{out_filename}.flac'"
45
+ )
46
 
47
+ with open(out_filename + ".flac", "rb") as f:
48
  s = "\n" + out_filename + "\n"
49
  s += base64.b64encode(f.read()).decode()
50
  logging.info(s)
 
183
  description = """
184
  This space shows how to do automatic speech recognition with Next-gen Kaldi.
185
 
186
+ Please visit
187
+ <https://huggingface.co/spaces/k2-fsa/streaming-automatic-speech-recognition>
188
+ for streaming speech recognition with **Next-gen Kaldi**.
189
+
190
  It is running on CPU within a docker container provided by Hugging Face.
191
 
192
  See more information by visiting the following links: