Spaces:
Runtime error
Runtime error
# 3rd party - located in requirements.txt | |
import streamlit as st | |
# local | |
import summarizer | |
st.set_page_config(page_title='Transcript Notetaker', page_icon=':memo:', layout='wide') | |
# App Content | |
''' | |
# Transcript Notetaker | |
Upload a transcript of a Google Meet call and this app will use the OpenAI API to generate detailed notes for the meeting. | |
_This program was designed to work with the transcript documents automatically generated by Google Meet meetings, using | |
transcripts with a different format may result in unexpected behavior._ | |
''' | |
api_key = st.text_input("Enter your OpenAI API key", type='password') | |
uploaded_file = st.file_uploader('Upload your Transcript', type='.txt') | |
if api_key and uploaded_file: | |
create_notes_button_disabled = False | |
create_notes_button_help = '' | |
else: | |
create_notes_button_disabled = True | |
create_notes_button_help = "Enter your API key and upload a file to continue" | |
button_create_notes = st.button("Create Notes", disabled=create_notes_button_disabled, help=create_notes_button_help) | |
meeting_notes = None | |
if button_create_notes: | |
header, transcript = summarizer.load_transcript(uploaded_file) | |
chunks = summarizer.chunk_transcript(transcript) | |
summaries = summarizer.summarize_chunks(chunks, api_key) | |
meeting_notes = summarizer.format_notes(summaries, header) | |
if meeting_notes: | |
st.divider() | |
st.download_button("Download Notes", meeting_notes, "notes.md") | |
st.markdown(meeting_notes) | |