import streamlit as st import base64 from pathlib import Path def get_image_base64(image_path: Path) -> str: """Convert image to base64 string""" if not image_path.exists(): st.error(f"Logo not found at {image_path}") return "" with open(image_path, "rb") as img_file: return base64.b64encode(img_file.read()).decode("utf-8") def render_contribution_guide(): """Render the contribution guide section""" st.markdown("### 🚀 Contribute") st.markdown( """ How does your device stack up? Benchmark your phone and join the leaderboard! """ ) # Store badges in a row container st.markdown('
', unsafe_allow_html=True) col1, col2 = st.columns(2) with col1: # Google Play badge playstore_badge = Path("src/static/images/GetItOnGooglePlay_Badge.png") if playstore_badge.exists(): st.markdown( f'' f'Get it on Google Play' "", unsafe_allow_html=True, ) with col2: # App Store badge appstore_badge = Path("src/static/images/Download_on_the_App_Store_Badge.svg") if appstore_badge.exists(): st.markdown( f'' f'Download on the App Store' "", unsafe_allow_html=True, ) st.markdown("
", unsafe_allow_html=True) # Steps to contribute st.markdown( """ #### Quick Guide: 1. **Download** PocketPal AI 2. **Get** your preferred model 3. **Run** benchmark 4. **Submit** to leaderboard """ ) # Demo video/gif demo_gif = Path("src/static/images/Bench.gif") if demo_gif.exists(): st.markdown( f'
' f'Benchmark Demo' "
", unsafe_allow_html=True, ) def render_header(): """Render the application header with logos""" # Logo paths #pocketpal_logo_path = Path("src/static/images/pocketpal-ai-logo-new-year.png") pocketpal_logo_path = Path("src/static/images/pocketpal-ai-logo.png") header_html = f"""

AI Phone Leaderboard

Comparing Large Language Models performance across AI Phones. Powered by PocketPal AI.

""" st.markdown(header_html, unsafe_allow_html=True)