Update app.py
Browse files
app.py
CHANGED
@@ -14,62 +14,19 @@ load_dotenv()
|
|
14 |
logging.basicConfig(level=logging.INFO)
|
15 |
logger = logging.getLogger(__name__)
|
16 |
|
17 |
-
# Definir rutas de archivos de imagen
|
18 |
-
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
|
19 |
-
ASSETS_DIR = os.path.join(ROOT_DIR, 'assets', 'img')
|
20 |
-
LOGO_PATH = os.path.join(ASSETS_DIR, 'aideaText_logo.png')
|
21 |
-
ICON_PATH = os.path.join(ASSETS_DIR, 'aideaText.ico')
|
22 |
-
|
23 |
-
def load_assets():
|
24 |
-
"""
|
25 |
-
Carga los archivos de imágenes necesarios
|
26 |
-
"""
|
27 |
-
try:
|
28 |
-
# Cargar ícono
|
29 |
-
if os.path.exists(ICON_PATH):
|
30 |
-
icon = Image.open(ICON_PATH)
|
31 |
-
else:
|
32 |
-
icon = "🧠" # Emoji por defecto
|
33 |
-
logger.warning("Archivo de ícono no encontrado")
|
34 |
-
|
35 |
-
return icon
|
36 |
-
except Exception as e:
|
37 |
-
logger.error(f"Error cargando assets: {str(e)}")
|
38 |
-
return "🧠"
|
39 |
-
|
40 |
-
# Cargar ícono antes de la configuración de la página
|
41 |
-
page_icon = load_assets()
|
42 |
-
|
43 |
# Configuración de la página
|
44 |
st.set_page_config(
|
45 |
page_title="AIdeaText",
|
46 |
layout="wide",
|
47 |
-
page_icon=
|
48 |
-
initial_sidebar_state="expanded"
|
49 |
)
|
50 |
|
51 |
-
#
|
52 |
-
|
53 |
-
""
|
54 |
-
|
55 |
-
""
|
56 |
-
|
57 |
-
if os.path.exists(LOGO_PATH):
|
58 |
-
st.logo(
|
59 |
-
image=LOGO_PATH,
|
60 |
-
icon_image=LOGO_PATH,
|
61 |
-
size="medium",
|
62 |
-
link="https://aideatext.ai"
|
63 |
-
)
|
64 |
-
return True
|
65 |
-
else:
|
66 |
-
logger.warning("Archivo de logo no encontrado")
|
67 |
-
return False
|
68 |
-
except Exception as e:
|
69 |
-
logger.error(f"Error configurando logo: {str(e)}")
|
70 |
-
return False
|
71 |
-
|
72 |
-
|
73 |
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
74 |
|
75 |
# Importaciones locales
|
|
|
14 |
logging.basicConfig(level=logging.INFO)
|
15 |
logger = logging.getLogger(__name__)
|
16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
# Configuración de la página
|
18 |
st.set_page_config(
|
19 |
page_title="AIdeaText",
|
20 |
layout="wide",
|
21 |
+
page_icon="./assets/img/aideaText.ico"
|
|
|
22 |
)
|
23 |
|
24 |
+
# Configuración simple del logo
|
25 |
+
st.logo(
|
26 |
+
"assets/img/aideaText_logo.png", # Logo principal
|
27 |
+
size="medium", # Tamaño: "small", "medium", o "large"
|
28 |
+
link="https://aideatext.ai" # URL opcional
|
29 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
31 |
|
32 |
# Importaciones locales
|