Spaces:
Sleeping
Sleeping
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")) | |