retrAIced / app.py
JavierGon12's picture
Omit Text generatos cause it takes ages
6433e18
import streamlit as st
from PIL import Image
from transformers import pipeline
from pathlib import Path
import base64
from st_pages import Page, add_page_title, show_pages
# Config
# Initial page config
st.set_page_config(
page_title='RetrAIced',
page_icon=':🧠:',
layout="wide",
initial_sidebar_state="expanded",
)
def local_css(file_name):
with open(file_name) as f:
st.markdown(f"<style>{f.read()}</style>", unsafe_allow_html=True)
local_css("style.css")
def img_to_bytes(img_path):
img_bytes = Path(img_path).read_bytes()
encoded = base64.b64encode(img_bytes).decode()
return encoded
show_pages(
[
Page("app.py", "Home", "🏠"),
Page("pages/Question Answering.py", "Question Answering", ":grey_question:"),
Page("pages/Speech Recognition.py", "Speech Recognition", ":speaking_head_in_silhouette:"),
Page("pages/Summarization.py", "Summarization",":bookmark_tabs:"),
Page("pages/Text to Image.py", "Text to Image",":lower_left_paintbrush:"),
Page("pages/Text Classification.py",'Text Classification',":book:"),
Page("pages/Image to text.py","Image to Text",":camera:"),
#Page("pages/Text Generation.py", "Text Generation", ":printer:"),
]
)
col1,col2,col3=st.columns(3)
with col1:
st.header("RetrAIced")
with col3:
st.image("logo retraced 2.png",width=150,caption = "retrAIced logo generated by Text to Image model")
st.write("##")
st.markdown(
"""
Welcome to **RetrAIced**, the cool app that brings together a bunch of AI models in one place.
It's like a playground for exploring all kinds of AI stuff, from understanding language to recognizing images.
You can see real-time demos of predictive analytics and how different AI technologies work together.
Everyone can jump in and play around with models for things like answering questions, recognizing speech, summarizing text, and creating more text.
It's like entering a smart digital space where projects get a boost to be more flexible, efficient, and enjoyable.\n
RetrAIced is powered by models from ***Hugging Face***, a key player in the language model world.
Language models (LLMs), especially those from Hugging Face, have transformed natural language understanding and generation,
becoming indispensable in today's data-driven world. RetrAIced exemplifies the collaborative potential of AI by breaking down barriers between different models, making their collective power accessible to users of all backgrounds. \n
Come along on a fun ride into the language model world with RetrAIced! You'll uncover a bunch of possibilities and see how things can get way easier and more intuitive with AI.
"""
, unsafe_allow_html=True)
st.write("##")
st.write("##")
#Create 2 columns to add github repo and huggging face repo
left_col, right_col = st.columns(2)
with left_col:
st.info('**Hugging Face: [@JavierGon12](https://huggingface.co/JavierGon12)**', icon="πŸ’‘")