Update app.py
Browse files
app.py
CHANGED
@@ -1,22 +1,24 @@
|
|
1 |
-
import streamlit as st
|
2 |
-
from utlis import *
|
3 |
-
|
4 |
-
from st_audiorec import st_audiorec
|
5 |
-
|
6 |
-
st.title("Live Speech to Job Offer Generator")
|
7 |
-
|
8 |
-
# Capture live audio
|
9 |
-
wav_audio_data = st_audiorec()
|
10 |
-
|
11 |
-
if wav_audio_data is not None:
|
12 |
-
# Convert audio to text
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
st.
|
22 |
-
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from utlis import *
|
3 |
+
|
4 |
+
from st_audiorec import st_audiorec
|
5 |
+
|
6 |
+
st.title("Live Speech to Job Offer Generator")
|
7 |
+
|
8 |
+
# Capture live audio
|
9 |
+
wav_audio_data = st_audiorec()
|
10 |
+
|
11 |
+
if wav_audio_data is not None:
|
12 |
+
# Convert audio to text
|
13 |
+
with st.spinner("Converting..."):
|
14 |
+
transcribed_text = audio_to_text(wav_audio_data)
|
15 |
+
st.markdown("_Transcribed Text:_", unsafe_allow_html=True) # Italicize and center the label
|
16 |
+
st.markdown(f'<p style="text-align: center;">"{transcribed_text}"</p>', unsafe_allow_html=True) # Center the transcribed text and keep it in quotes
|
17 |
+
|
18 |
+
|
19 |
+
if transcribed_text and st.button("Generate Job Offer"):
|
20 |
+
# Generate the job offer from the text
|
21 |
+
with st.spinner("Generate..."):
|
22 |
+
job_offer = call_ai_api(transcribed_text)
|
23 |
+
st.write("Generated Job Offer:")
|
24 |
+
st.write(job_offer)
|