barghavani commited on
Commit
376988d
·
verified ·
1 Parent(s): e7921c5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -11,7 +11,6 @@ from langchain.prompts import PromptTemplate
11
  from dotenv import load_dotenv
12
  from st_audiorec import st_audiorec
13
  import whisper
14
- from txtai.pipeline import Translation
15
 
16
  genai.configure(api_key=os.getenv("GOOGLE_API_KEY"))
17
 
@@ -77,10 +76,9 @@ def user_input(user_question):
77
 
78
 
79
 
80
-
81
  def main():
82
  st.set_page_config("Chat PDF")
83
- st.header("Speak QnA with Multiple PDF files💁")
84
 
85
  # Audio recording
86
  wav_audio_data = st_audiorec()
@@ -90,9 +88,9 @@ def main():
90
  f.write(wav_audio_data)
91
 
92
  model = whisper.load_model("large")
93
- result = model.transcribe("query.wav", language="en",fp16=False)
94
  user_question = result["text"]
95
- st.write("Translated Question:", user_question)
96
  user_input(user_question)
97
 
98
  with st.sidebar:
 
11
  from dotenv import load_dotenv
12
  from st_audiorec import st_audiorec
13
  import whisper
 
14
 
15
  genai.configure(api_key=os.getenv("GOOGLE_API_KEY"))
16
 
 
76
 
77
 
78
 
 
79
  def main():
80
  st.set_page_config("Chat PDF")
81
+ st.header("QnA with Multiple PDF files💁")
82
 
83
  # Audio recording
84
  wav_audio_data = st_audiorec()
 
88
  f.write(wav_audio_data)
89
 
90
  model = whisper.load_model("large")
91
+ result = model.transcribe("query.wav", language="en", fp16=False)
92
  user_question = result["text"]
93
+ st.write("Transcribed Question:", user_question)
94
  user_input(user_question)
95
 
96
  with st.sidebar: