waysolong commited on
Commit
dafc7b5
·
1 Parent(s): 1b38289
Files changed (1) hide show
  1. app.py +1 -13
app.py CHANGED
@@ -20,7 +20,6 @@ import uuid
20
  from datetime import datetime
21
 
22
  import gradio as gr
23
- import torch
24
 
25
  from examples import examples
26
  from deploy_model import decode, get_pretrained_model,language_to_models
@@ -125,7 +124,6 @@ def process_microphone(
125
  logging.info(str(e))
126
  return "", build_html_output(str(e), "result_item_error")
127
 
128
- @torch.no_grad()
129
  def process(
130
  language: str,
131
  repo_id: str,
@@ -146,11 +144,7 @@ def process(
146
 
147
  start = time.time()
148
 
149
- recognizer = get_pretrained_model(
150
- repo_id,
151
- decoding_method=decoding_method,
152
- num_active_paths=num_active_paths,
153
- )
154
 
155
  text = decode(recognizer, filename)
156
 
@@ -346,12 +340,6 @@ with demo:
346
  )
347
 
348
  gr.Markdown(description)
349
- torch.set_num_threads(1)
350
- torch.set_num_interop_threads(1)
351
-
352
- torch._C._jit_set_profiling_executor(False)
353
- torch._C._jit_set_profiling_mode(False)
354
- torch._C._set_graph_executor_optimize(False)
355
 
356
  if __name__ == "__main__":
357
  formatter = "%(asctime)s %(levelname)s [%(filename)s:%(lineno)d] %(message)s"
 
20
  from datetime import datetime
21
 
22
  import gradio as gr
 
23
 
24
  from examples import examples
25
  from deploy_model import decode, get_pretrained_model,language_to_models
 
124
  logging.info(str(e))
125
  return "", build_html_output(str(e), "result_item_error")
126
 
 
127
  def process(
128
  language: str,
129
  repo_id: str,
 
144
 
145
  start = time.time()
146
 
147
+ recognizer = get_pretrained_model()
 
 
 
 
148
 
149
  text = decode(recognizer, filename)
150
 
 
340
  )
341
 
342
  gr.Markdown(description)
 
 
 
 
 
 
343
 
344
  if __name__ == "__main__":
345
  formatter = "%(asctime)s %(levelname)s [%(filename)s:%(lineno)d] %(message)s"