-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
37 lines (29 loc) · 1.24 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import streamlit as st
from articles import articles
from youtube import youtube_summary
if "show_homepage_content" not in st.session_state:
st.session_state.show_homepage_content = True # Initial state
def display_homepage_content():
st.title("TopicHub 🎥")
with st.expander("Click to view rules"):
st.markdown(
"This is an End to End LLM Project Made using Langchain. User initially have 2 choices either they can "
"directly talk with the new articles whether it is summarization or QnA related to it, "
"up to 3 URLs"
"are"
"supported and another one is User can input the Youtube Video Link and the summary for the "
"video ill"
"be"
"provided. LLM Model used - Open AI")
st.sidebar.title("Functionalities")
if st.sidebar.button("Homepage"):
st.session_state.show_homepage_content = True
if st.sidebar.button("News Articles"):
st.session_state.show_homepage_content = False
articles()
if st.sidebar.button("Youtube Video Summarization"):
st.session_state.show_homepage_content = False
youtube_summary()
# --- Display Content based on State---
if st.session_state.show_homepage_content:
display_homepage_content()