application_ai / app.py
jwphantom
finish nlp
a87363f
import streamlit as st
from streamlit_option_menu import option_menu
from modules import chatbot, text_to_speech, image_classification, image_to_text
from utils import styles, helpers
# Configuration initiale de la page Streamlit avec un titre et un layout spécifié.
st.set_page_config(page_title="Application IA", layout="wide")
# Application des styles CSS personnalisés pour l'application.
styles.apply_styles()
# Création du Menu de Navigation
with st.sidebar:
menu = option_menu(
"Onyx AI",
["Acceuil", "Documentation"],
icons=["play-btn", "info-circle"],
menu_icon="rocket",
default_index=0,
styles={
"container": {"background-color": "transparent"},
"icon": {"color": "#374151", "font-size": "17px"},
"nav-link": {
"font-size": "17px",
"text-align": "left",
"margin": "0px",
"--hover-color": "#eee",
},
"nav-link-selected": {"background-color": "#519ba7"},
},
)
# Gestion des Sections de l'Application
if menu == "Acceuil":
# # Contenu de la navbar avec des icônes appropriées
selected = option_menu(
menu_title=None,
options=[
"Chatbot",
"TextToSpeech",
"Classification",
"Image to text",
],
icons=[
"robot",
"volume-up",
"camera",
"file-text",
],
menu_icon="cast",
default_index=0,
orientation="horizontal",
styles={
"container": {
"background-color": "#fafafa",
"border-radius": "8px",
"background": "#fbfafa",
},
"icon": {"color": "#374151", "font-size": "17px"},
"nav-link": {
"font-size": "17px",
"text-align": "left",
"--hover-color": "#eee",
},
"nav-link-selected": {
"background-color": "#519ba7",
},
},
)
if selected == "Chatbot":
chatbot.show()
elif selected == "TextToSpeech":
text_to_speech.show()
elif selected == "Classification":
image_classification.show()
elif selected == "Image to text":
image_to_text.show()
elif menu == "Documentation":
helpers.show()