Spaces:
Runtime error
Runtime error
Add application file
Browse files- app.py +10 -6
- requirements.txt +1 -1
app.py
CHANGED
@@ -5,7 +5,6 @@ from streamlit_float import *
|
|
5 |
from openai import OpenAI
|
6 |
import os
|
7 |
from dotenv import load_dotenv
|
8 |
-
import base64
|
9 |
|
10 |
load_dotenv()
|
11 |
api_key = os.getenv("openai_api_key")
|
@@ -15,8 +14,10 @@ client = OpenAI(api_key=api_key)
|
|
15 |
|
16 |
#set title
|
17 |
st.title("Audio to Text Converter 🤖")
|
18 |
-
with st.popover(label=":information_source:",help="
|
19 |
st.markdown("This is a demo app. This is to convert audio to text.")
|
|
|
|
|
20 |
|
21 |
|
22 |
def speech_to_text(audio_data):
|
@@ -43,17 +44,18 @@ def initialize_session_state():
|
|
43 |
initialize_session_state()
|
44 |
|
45 |
#create footer container
|
46 |
-
footer_container = st.container(
|
47 |
with footer_container:
|
48 |
#create footer
|
49 |
-
st.write("Created by [@Predikly](XXXXXXXXXXXXXXXXXXXXXXXXXX)")
|
50 |
audio_bytes = audio_recorder(
|
51 |
-
text="",
|
52 |
recording_color="#e8b62c",
|
53 |
neutral_color="#6aa36f",
|
54 |
icon_name="microphone",
|
55 |
icon_size="2x",
|
56 |
-
|
|
|
|
|
57 |
|
58 |
|
59 |
|
@@ -78,4 +80,6 @@ if audio_bytes:
|
|
78 |
st.write(transcript)
|
79 |
os.remove(webm_file_path)
|
80 |
|
|
|
|
|
81 |
|
|
|
5 |
from openai import OpenAI
|
6 |
import os
|
7 |
from dotenv import load_dotenv
|
|
|
8 |
|
9 |
load_dotenv()
|
10 |
api_key = os.getenv("openai_api_key")
|
|
|
14 |
|
15 |
#set title
|
16 |
st.title("Audio to Text Converter 🤖")
|
17 |
+
with st.popover(label=":information_source:",help="for more info"):
|
18 |
st.markdown("This is a demo app. This is to convert audio to text.")
|
19 |
+
st.markdown("Created by [@Predikly](XXXXXXXXXXXXXXXXXXXXXXXXXX)")
|
20 |
+
|
21 |
|
22 |
|
23 |
def speech_to_text(audio_data):
|
|
|
44 |
initialize_session_state()
|
45 |
|
46 |
#create footer container
|
47 |
+
footer_container = st.container()
|
48 |
with footer_container:
|
49 |
#create footer
|
|
|
50 |
audio_bytes = audio_recorder(
|
51 |
+
text="Click to record",
|
52 |
recording_color="#e8b62c",
|
53 |
neutral_color="#6aa36f",
|
54 |
icon_name="microphone",
|
55 |
icon_size="2x",
|
56 |
+
key="audio_recorder")
|
57 |
+
|
58 |
+
|
59 |
|
60 |
|
61 |
|
|
|
80 |
st.write(transcript)
|
81 |
os.remove(webm_file_path)
|
82 |
|
83 |
+
|
84 |
+
|
85 |
|
requirements.txt
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
audio_recorder_streamlit==0.0.
|
2 |
openai==1.30.5
|
3 |
python-dotenv==1.0.1
|
4 |
streamlit==1.29.0
|
|
|
1 |
+
audio_recorder_streamlit==0.0.8
|
2 |
openai==1.30.5
|
3 |
python-dotenv==1.0.1
|
4 |
streamlit==1.29.0
|