Spaces:
Build error
Build error
Commit
·
8390518
1
Parent(s):
fa0be23
Update app.py
Browse files
app.py
CHANGED
@@ -28,19 +28,8 @@ def transcribe(file_mic, target_language):
|
|
28 |
|
29 |
target_code = target_language.split("(")[-1].split(")")[0]
|
30 |
forced_bos_token_id = MAPPING[target_code]
|
31 |
-
|
32 |
-
warn_output = ""
|
33 |
-
if (file_mic is not None) and (file_upload is not None):
|
34 |
-
warn_output = "WARNING: You've uploaded an audio file and used the microphone. The recorded file from the microphone will be used and the uploaded audio will be discarded.\n"
|
35 |
-
file = file_mic
|
36 |
-
elif (file_mic is None) and (file_upload is None):
|
37 |
-
return "ERROR: You have to either use the microphone or upload an audio file"
|
38 |
-
elif file_mic is not None:
|
39 |
-
file = file_mic
|
40 |
-
else:
|
41 |
-
file = file_upload
|
42 |
|
43 |
-
input_values = process_audio_file(
|
44 |
|
45 |
sequences = model.generate(input_values, forced_bos_token_id=forced_bos_token_id)
|
46 |
|
|
|
28 |
|
29 |
target_code = target_language.split("(")[-1].split(")")[0]
|
30 |
forced_bos_token_id = MAPPING[target_code]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
|
32 |
+
input_values = process_audio_file(file_mic)
|
33 |
|
34 |
sequences = model.generate(input_values, forced_bos_token_id=forced_bos_token_id)
|
35 |
|