Update app.py
Browse files
app.py
CHANGED
@@ -51,7 +51,7 @@ def chat_chain(vectorstore):
|
|
51 |
)
|
52 |
return chain
|
53 |
|
54 |
-
#
|
55 |
def transcribe_audio(file_path):
|
56 |
"""Transcribe audio using Groq's Whisper model."""
|
57 |
with open(file_path, "rb") as file:
|
@@ -61,7 +61,8 @@ def transcribe_audio(file_path):
|
|
61 |
response_format="json",
|
62 |
language="en"
|
63 |
)
|
64 |
-
|
|
|
65 |
|
66 |
# Streamlit UI
|
67 |
st.title("Chat with PDFs via Audio ποΈπ")
|
|
|
51 |
)
|
52 |
return chain
|
53 |
|
54 |
+
# Function to transcribe audio using Groq's Whisper
|
55 |
def transcribe_audio(file_path):
|
56 |
"""Transcribe audio using Groq's Whisper model."""
|
57 |
with open(file_path, "rb") as file:
|
|
|
61 |
response_format="json",
|
62 |
language="en"
|
63 |
)
|
64 |
+
# Access the text attribute
|
65 |
+
return transcription.text
|
66 |
|
67 |
# Streamlit UI
|
68 |
st.title("Chat with PDFs via Audio ποΈπ")
|