Tonic commited on
Commit
72be11a
·
1 Parent(s): d5f038c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -14
app.py CHANGED
@@ -72,7 +72,7 @@ if st.button('Start Transcription'):
72
  st.info("Transcribing...")
73
  st.success("Transcription complete")
74
  result = model.transcribe(audio_file_path)
75
- st.session_state.transcript = result['text']
76
 
77
  with st.expander("See transcript"):
78
  st.markdown(transcript)
@@ -176,21 +176,22 @@ for i, summary in enumerate(summaries):
176
  st.write(f"### Summary {i+1}")
177
  st.write(summary)
178
 
179
- # Display the Whisper transcription, extracted claims, and BERT summaries in the same text box
180
- if transcript:
181
  st.text("Transcription, Extracted Claims, and BERT Summaries:")
182
-
183
- # Concatenate the Whisper transcription, extracted claims, and BERT summaries into a single string
184
- #results_text = f"Whisper Transcription:\n{transcript}\n\n"
185
- #results_text += f"Extracted Claims:\n{claims_extracted}\n\n"
186
- results_text += "BERT Summaries:\n"
187
-
188
- with st.spinner('Generating Summaries...'):
 
 
 
 
189
  for i, summary in enumerate(summaries):
190
- results_text += f"Summary {i+1}:\n{summary}\n\n"
191
-
192
- # Display the concatenated results
193
- st.text(results_text)
194
 
195
  # Citation for the GitHub repo
196
  st.markdown("<sub>This app was created by [Tonic](https://huggingface.co/tonic) with help from [MIND INTERFACES](https://huggingface.co/MIND-INTERFACES) & (Taylor)[https://huggingface.co/Cloudfaith] [join us on discord](https://discord.gg/5RmtZVVfgQ) </sub>", unsafe_allow_html=True)
 
72
  st.info("Transcribing...")
73
  st.success("Transcription complete")
74
  result = model.transcribe(audio_file_path)
75
+ transcript = result['text'] # Define the 'transcript' variable
76
 
77
  with st.expander("See transcript"):
78
  st.markdown(transcript)
 
176
  st.write(f"### Summary {i+1}")
177
  st.write(summary)
178
 
179
+ # Display the Whisper transcription, extracted claims, and BERT summaries in a text box
180
+ if 'transcript' in locals() and 'claims_extracted' in st.session_state:
181
  st.text("Transcription, Extracted Claims, and BERT Summaries:")
182
+
183
+ if 'transcript' in locals():
184
+ st.text("Transcription:")
185
+ st.text(transcript)
186
+
187
+ if 'claims_extracted' in st.session_state:
188
+ st.text("Extracted Claims:")
189
+ st.text(st.session_state.claims_extracted)
190
+
191
+ if summaries:
192
+ st.text("BERT Summaries:")
193
  for i, summary in enumerate(summaries):
194
+ st.text(f"Summary {i + 1}:\n{summary}")
 
 
 
195
 
196
  # Citation for the GitHub repo
197
  st.markdown("<sub>This app was created by [Tonic](https://huggingface.co/tonic) with help from [MIND INTERFACES](https://huggingface.co/MIND-INTERFACES) & (Taylor)[https://huggingface.co/Cloudfaith] [join us on discord](https://discord.gg/5RmtZVVfgQ) </sub>", unsafe_allow_html=True)