Update app.py
Browse files
app.py
CHANGED
@@ -43,15 +43,15 @@ def parse_transcription(logits):
|
|
43 |
|
44 |
|
45 |
# Function to retrieve an answer based on a question (using fuzzy matching)
|
46 |
-
def get_answer(wav_file
|
47 |
|
48 |
-
if
|
49 |
input_values = read_file_and_process(wav_file)
|
50 |
with torch.no_grad():
|
51 |
logits = model(**input_values).logits
|
52 |
user_question = parse_transcription(logits)
|
53 |
-
|
54 |
-
user_question =
|
55 |
|
56 |
highest_score = 0
|
57 |
best_answer = None
|
|
|
43 |
|
44 |
|
45 |
# Function to retrieve an answer based on a question (using fuzzy matching)
|
46 |
+
def get_answer(wav_file):
|
47 |
|
48 |
+
if type(wav_file) != 'str':
|
49 |
input_values = read_file_and_process(wav_file)
|
50 |
with torch.no_grad():
|
51 |
logits = model(**input_values).logits
|
52 |
user_question = parse_transcription(logits)
|
53 |
+
else:
|
54 |
+
user_question = wav_file
|
55 |
|
56 |
highest_score = 0
|
57 |
best_answer = None
|