Update app.py
Browse files
app.py
CHANGED
@@ -43,21 +43,21 @@ The model was trained on Thai audio recordings with the following sentences: \n
|
|
43 |
|
44 |
|
45 |
|
46 |
-
def predict(
|
47 |
max_length = 100000
|
48 |
-
file_path = filepath(file_upload)
|
49 |
-
if (microphone is not None) and (file_upload is not None):
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
|
55 |
-
elif (microphone is None) and (file_upload is None):
|
56 |
-
|
57 |
-
if(microphone is not None):
|
58 |
-
|
59 |
-
if(file_upload is not None):
|
60 |
-
|
61 |
model.eval()
|
62 |
with torch.no_grad():
|
63 |
wav_data, _ = sf.read(file_path.name)
|
|
|
43 |
|
44 |
|
45 |
|
46 |
+
def predict(file_path,microphone_path):
|
47 |
max_length = 100000
|
48 |
+
# file_path = filepath(file_upload)
|
49 |
+
# if (microphone is not None) and (file_upload is not None):
|
50 |
+
# warn_output = (
|
51 |
+
# "WARNING: You've uploaded an audio file and used the microphone. "
|
52 |
+
# "The recorded file from the microphone will be used and the uploaded audio will be discarded.\n"
|
53 |
+
# )
|
54 |
|
55 |
+
# elif (microphone is None) and (file_upload is None):
|
56 |
+
# return "ERROR: You have to either use the microphone or upload an audio file"
|
57 |
+
# if(microphone is not None):
|
58 |
+
# file_path = filepath(microphone)
|
59 |
+
# if(file_upload is not None):
|
60 |
+
# file_path = filepath(microphone)
|
61 |
model.eval()
|
62 |
with torch.no_grad():
|
63 |
wav_data, _ = sf.read(file_path.name)
|