Anshini's picture
Update app.py
9f28f76 verified
raw
history blame
2.28 kB
import streamlit as st
import os
from langchain_huggingface import HuggingFaceEndpoint, HuggingFacePipeline, ChatHuggingFace
from langchain_core.messages import HumanMessage,SystemMessage,AIMessage
hf_token = os.getenv("HF_TOKEN")
# Set the default page in session state
if "page" not in st.session_state:
st.session_state.page = "home"
# Function to switch pages
def switch_page(page_name):
st.session_state.page = page_name
# Home page with buttons for different domains
if st.session_state.page == "home":
st.title("πŸ€– ChatGenius Hub: Master Every Data Skills")
st.markdown("Choose a domain to chat with an expert model:")
col1, col2, col3 = st.columns(3)
with col1:
if st.button("Python 🐍"):
switch_page("python")
if st.button("Machine Learning πŸ€–"):
switch_page("ml")
with col2:
if st.button("SQL πŸ›’οΈ"):
switch_page("sql")
if st.button("Deep Learning 🧠"):
switch_page("deeplearning")
with col3:
if st.button("Power BI πŸ“Š"):
switch_page("powerbi")
if st.button("Statistics πŸ“ˆ"):
switch_page("statistics")
# Example domain-specific chatbot page
elif st.session_state.page == "python":
st.title("Python Chatbot 🐍")
st.button("⬅️ Back to Home", on_click=lambda: switch_page("home"))
# Here you can load your Python LLM and chat interface
elif st.session_state.page == "sql":
st.title("SQL Chatbot πŸ›’οΈ")
st.button("⬅️ Back to Home", on_click=lambda: switch_page("home"))
# Load SQL chatbot here
elif st.session_state.page == "powerbi":
st.title("Power BI Chatbot πŸ“Š")
st.button("⬅️ Back to Home", on_click=lambda: switch_page("home"))
elif st.session_state.page == "ml":
st.title("Machine Learning Chatbot πŸ€–")
st.button("⬅️ Back to Home", on_click=lambda: switch_page("home"))
elif st.session_state.page == "deeplearning":
st.title("Deep Learning Chatbot 🧠")
st.button("⬅️ Back to Home", on_click=lambda: switch_page("home"))
elif st.session_state.page == "statistics":
st.title("Statistics Chatbot πŸ“ˆ")
st.button("⬅️ Back to Home", on_click=lambda: switch_page("home"))