kobakhit commited on
Commit
f0e6051
·
1 Parent(s): cfcb5c6
Files changed (1) hide show
  1. app.py +14 -4
app.py CHANGED
@@ -109,28 +109,38 @@ if "messages" not in st.session_state:
109
  st.session_state.messages = initial_prompt
110
 
111
 
112
- st.title("Speech to Chat")
113
  reddit_thread = 'https://www.reddit.com/r/dataisbeautiful/comments/17413bq/oc_speech_diarization_app_that_transcribes_audio'
114
 
115
  with st.sidebar:
116
  st.markdown('''
117
  # How to Use
118
 
119
- 1. Enter a youtube link or upload an audio file.
120
- 2. "Chat" with the file.
121
 
122
  Example prompts:
123
  - Which speaker spoke the most?
124
  - What are important keywords in the transcript for SEO?
125
  ''')
126
 
 
 
 
 
 
 
 
 
 
 
127
  st.divider()
128
 
129
  st.markdown(f'''
130
  # About
131
 
132
  Given an audio file or a youtube link this app will
133
- - [x] 1. Parition the audio according to the identity of each speaker (diarization) using `pyannote` [HuggingFace Speaker Diarization api](https://huggingface.co/pyannote/speaker-diarization-3.0)
134
  - [x] 2. Transcribe each audio segment using [OpenAi Whisper API](https://platform.openai.com/docs/guides/speech-to-text/quickstart)
135
  - [x] 3. Set up an LLM chat with the transcript loaded into its knowledge database, so that a user can "talk" to the transcript of the audio file.
136
 
 
109
  st.session_state.messages = initial_prompt
110
 
111
 
112
+ st.title("Speech-to-Chat")
113
  reddit_thread = 'https://www.reddit.com/r/dataisbeautiful/comments/17413bq/oc_speech_diarization_app_that_transcribes_audio'
114
 
115
  with st.sidebar:
116
  st.markdown('''
117
  # How to Use
118
 
119
+ 1. Enter a youtube link.
120
+ 2. "Chat" with the video.
121
 
122
  Example prompts:
123
  - Which speaker spoke the most?
124
  - What are important keywords in the transcript for SEO?
125
  ''')
126
 
127
+ api_key_input = st.text_input(
128
+ "OpenAI API Key to lift request limits (Coming soon)",
129
+ disabled=True,
130
+ type="password",
131
+ placeholder="Paste your OpenAI API key here (sk-...)",
132
+ help="You can get your API key from https://platform.openai.com/account/api-keys.", # noqa: E501
133
+ value=os.environ.get("OPENAI_API_KEY", None)
134
+ or st.session_state.get("OPENAI_API_KEY", ""),
135
+ )
136
+
137
  st.divider()
138
 
139
  st.markdown(f'''
140
  # About
141
 
142
  Given an audio file or a youtube link this app will
143
+ - [x] 1. Partition the audio according to the identity of each speaker (diarization) using `pyannote` [HuggingFace Speaker Diarization api](https://huggingface.co/pyannote/speaker-diarization-3.0)
144
  - [x] 2. Transcribe each audio segment using [OpenAi Whisper API](https://platform.openai.com/docs/guides/speech-to-text/quickstart)
145
  - [x] 3. Set up an LLM chat with the transcript loaded into its knowledge database, so that a user can "talk" to the transcript of the audio file.
146