nickmuchi commited on
Commit
4d99705
·
verified ·
1 Parent(s): 7592736

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +48 -47
app.py CHANGED
@@ -66,60 +66,61 @@ if latest_ep_button:
66
 
67
  # Dropdown box
68
  st.sidebar.subheader("Available Podcasts Feeds")
69
- selected_podcast = st.sidebar.selectbox("Select Podcast", options=podcast_five_titles,index=None,key='podcast_selection')
 
70
 
71
- if selected_podcast is not None:
72
 
73
- if 'podcast_selection' not in st.session_state:
74
- st.session_state.podcast_selection = selected_podcast
75
 
76
- print(selected_podcast)
77
-
78
- st.sidebar.markdown("**Note**: Podcast processing can take upto 5 mins, please be patient.")
79
-
80
- podcast_link = pods[st.session_state.podcast_selection][0]
81
- podcast_image = pods[st.session_state.podcast_selection][1]
82
 
83
- # Right section - Newsletter content
84
- st.header("Newsletter Content")
85
 
86
- # Display the podcast title
87
- st.subheader("Episode Title")
88
- st.write(selected_podcast)
89
 
90
- # Display the podcast summary and the cover image in a side-by-side layout
91
- col1, col2 = st.columns([7, 3])
92
 
93
- # Get podcast transcription and info
94
- podcast_info = process_podcast(podcast_link)
95
-
96
- with col1:
97
- # Display the podcast episode summary
98
- st.subheader("Podcast Episode Summary")
99
- st.write(podcast_info['podcast_summary'])
100
-
101
- if podcast_image:
102
- with col2:
103
- st.image(podcast_image, caption="Podcast Cover", width=300, use_column_width=True)
104
-
105
- # Display the podcast guest and their details in a side-by-side layout
106
- col3, col4 = st.columns([3, 7])
107
-
108
- with col3:
109
- st.subheader("Podcast Guest")
110
- st.write(podcast_info['podcast_guest'])
111
-
112
- with col4:
113
- st.subheader("Podcast Guest Details")
114
- st.write(podcast_info["podcast_guest_title"])
115
- st.write(podcast_info["podcast_guest_org"])
116
-
117
- # Display the five key moments
118
- st.subheader("Key Moments")
119
- key_moments = podcast_info['podcast_highlights']
120
- for moment in key_moments.split('\n'):
121
- st.markdown(
122
- f"<p style='margin-bottom: 5px;'>{moment}</p>", unsafe_allow_html=True)
123
 
124
 
125
 
 
66
 
67
  # Dropdown box
68
  st.sidebar.subheader("Available Podcasts Feeds")
69
+
70
+ selected_podcast = st.sidebar.selectbox("Select Podcast", options=podcast_five_titles,index=None,key='podcast_selection')
71
 
72
+ if selected_podcast is not None:
73
 
74
+ if 'podcast_selection' not in st.session_state:
75
+ st.session_state.podcast_selection = selected_podcast
76
 
77
+ print(selected_podcast)
78
+
79
+ st.sidebar.markdown("**Note**: Podcast processing can take upto 5 mins, please be patient.")
80
+
81
+ podcast_link = pods[st.session_state.podcast_selection][0]
82
+ podcast_image = pods[st.session_state.podcast_selection][1]
83
 
84
+ # Right section - Newsletter content
85
+ st.header("Newsletter Content")
86
 
87
+ # Display the podcast title
88
+ st.subheader("Episode Title")
89
+ st.write(selected_podcast)
90
 
91
+ # Display the podcast summary and the cover image in a side-by-side layout
92
+ col1, col2 = st.columns([7, 3])
93
 
94
+ # Get podcast transcription and info
95
+ podcast_info = process_podcast(podcast_link)
96
+
97
+ with col1:
98
+ # Display the podcast episode summary
99
+ st.subheader("Podcast Episode Summary")
100
+ st.write(podcast_info['podcast_summary'])
101
+
102
+ if podcast_image:
103
+ with col2:
104
+ st.image(podcast_image, caption="Podcast Cover", width=300, use_column_width=True)
105
+
106
+ # Display the podcast guest and their details in a side-by-side layout
107
+ col3, col4 = st.columns([3, 7])
108
+
109
+ with col3:
110
+ st.subheader("Podcast Guest")
111
+ st.write(podcast_info['podcast_guest'])
112
+
113
+ with col4:
114
+ st.subheader("Podcast Guest Details")
115
+ st.write(podcast_info["podcast_guest_title"])
116
+ st.write(podcast_info["podcast_guest_org"])
117
+
118
+ # Display the five key moments
119
+ st.subheader("Key Moments")
120
+ key_moments = podcast_info['podcast_highlights']
121
+ for moment in key_moments.split('\n'):
122
+ st.markdown(
123
+ f"<p style='margin-bottom: 5px;'>{moment}</p>", unsafe_allow_html=True)
124
 
125
 
126