Pavankalyan commited on
Commit
e5d627d
1 Parent(s): 17f3c05

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -34,11 +34,13 @@ from transformers import pipeline
34
  p = pipeline(model="openai/whisper-medium")
35
 
36
  def transcribe(text,audio):
37
- print(text)
38
- print(audio)
39
- if audio["filepath"]:
40
- audio["text"] = p(audio["filepath"])['text']
41
- ans = predict(audio["text"])
 
 
42
  return ans
43
 
44
 
 
34
  p = pipeline(model="openai/whisper-medium")
35
 
36
  def transcribe(text,audio):
37
+ if audio:
38
+ t = p(audio)['text']
39
+ ans = predict(t)
40
+ elif text:
41
+ ans = predict(text)
42
+ else:
43
+ ans = "please give input"
44
  return ans
45
 
46