jiuuee commited on
Commit
e6d8983
1 Parent(s): 1c73271

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -11
app.py CHANGED
@@ -78,14 +78,6 @@ def convert_audio(audio_filepath, tmpdir, utt_id):
78
  return out_filename, duration
79
 
80
 
81
- import os
82
- import json
83
- import uuid
84
- import tempfile
85
- import torch
86
- import torch.cuda.amp as amp
87
- import gr # Assuming this is your custom module
88
-
89
  def transcribe(audio_filepath):
90
  if audio_filepath is None:
91
  raise gr.Error("Please provide some input audio: either upload an audio file or use the microphone")
@@ -99,11 +91,11 @@ def transcribe(audio_filepath):
99
  manifest_data = {
100
  "audio_filepath": converted_audio_filepath,
101
  "source_lang": "en",
102
- "target_lang": "en"
103
- "taskname": taskname,
104
  "pnc": "no",
105
  "answer": "predict",
106
- "duration": str(duration),
107
  }
108
 
109
  manifest_filepath = os.path.join(tmpdir, f'{utt_id}.json')
 
78
  return out_filename, duration
79
 
80
 
 
 
 
 
 
 
 
 
81
  def transcribe(audio_filepath):
82
  if audio_filepath is None:
83
  raise gr.Error("Please provide some input audio: either upload an audio file or use the microphone")
 
91
  manifest_data = {
92
  "audio_filepath": converted_audio_filepath,
93
  "source_lang": "en",
94
+ "target_lang": "en",
95
+ "taskname": "asr",
96
  "pnc": "no",
97
  "answer": "predict",
98
+ "duration": 10,
99
  }
100
 
101
  manifest_filepath = os.path.join(tmpdir, f'{utt_id}.json')