Update app.py
Browse files
app.py
CHANGED
@@ -2,6 +2,7 @@ import soundfile as sf
|
|
2 |
import torch
|
3 |
from transformers import Wav2Vec2ForCTC, Wav2Vec2Processor,Wav2Vec2ProcessorWithLM
|
4 |
import gradio as gr
|
|
|
5 |
import subprocess
|
6 |
|
7 |
|
@@ -38,12 +39,7 @@ def parse(wav_file, applyLM):
|
|
38 |
input_values = read_file_and_process(wav_file)
|
39 |
with torch.no_grad():
|
40 |
logits = model(**input_values).logits
|
41 |
-
if applyLM:
|
42 |
-
return parse_transcription_with_lm(wav_file)
|
43 |
-
else:
|
44 |
-
return parse_transcription(wav_file)
|
45 |
|
46 |
-
|
47 |
if applyLM:
|
48 |
return parse_transcription_with_lm(logits)
|
49 |
else:
|
|
|
2 |
import torch
|
3 |
from transformers import Wav2Vec2ForCTC, Wav2Vec2Processor,Wav2Vec2ProcessorWithLM
|
4 |
import gradio as gr
|
5 |
+
import sox
|
6 |
import subprocess
|
7 |
|
8 |
|
|
|
39 |
input_values = read_file_and_process(wav_file)
|
40 |
with torch.no_grad():
|
41 |
logits = model(**input_values).logits
|
|
|
|
|
|
|
|
|
42 |
|
|
|
43 |
if applyLM:
|
44 |
return parse_transcription_with_lm(logits)
|
45 |
else:
|