nimool commited on
Commit
f7c6f7e
·
1 Parent(s): 8f1a55a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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=None, text=None):
47
 
48
- if text==None:
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
- elif text != None:
54
- user_question = text
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