| | |
| | """ |
| | Mizan Turkish Leaderboard - HuggingFace Space Version |
| | |
| | Clean entry point that wires together all components. |
| | """ |
| |
|
| | import logging |
| | import sys |
| |
|
| | import gradio as gr |
| |
|
| | from src.core.config import settings |
| | from src.data import DataTransformer |
| | from src.components import LeaderboardTab, DatasetTab, SubmitTab |
| |
|
| | |
| | logging.basicConfig( |
| | level=logging.DEBUG if settings.ui.debug else logging.INFO, |
| | format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', |
| | handlers=[ |
| | logging.StreamHandler(sys.stdout), |
| | ] |
| | ) |
| |
|
| | logger = logging.getLogger(__name__) |
| |
|
| |
|
| | class MizanApp: |
| | """ |
| | Main application class. |
| | |
| | Orchestrates all components and creates the Gradio interface. |
| | """ |
| | |
| | def __init__(self): |
| | |
| | self.transformer = DataTransformer() |
| | self.data = self.transformer.load_from_csv() |
| | |
| | |
| | self._leaderboard_tab: LeaderboardTab = None |
| | self._dataset_tab: DatasetTab = None |
| | self._submit_tab: SubmitTab = None |
| | |
| | logger.info(f"Application initialized with {len(self.data)} models") |
| | |
| | def build_interface(self) -> gr.Blocks: |
| | """ |
| | Build the complete Gradio interface. |
| | |
| | Returns: |
| | Gradio Blocks application. |
| | """ |
| | with gr.Blocks( |
| | title="๐น๐ท Mizan Turkish Leaderboard", |
| | theme=gr.themes.Soft() |
| | ) as demo: |
| | |
| | |
| | gr.Markdown(""" |
| | # ๐น๐ท Mizan Turkish Evaluation Leaderboard |
| | |
| | Performance comparison for Turkish embedding models |
| | """) |
| | |
| | with gr.Tabs(): |
| | |
| | with gr.Tab("Leaderboard"): |
| | self._leaderboard_tab = LeaderboardTab(data=self.data) |
| | self._leaderboard_tab.build() |
| | |
| | |
| | with gr.Tab("Submit"): |
| | self._submit_tab = SubmitTab() |
| | self._submit_tab.build() |
| | |
| | |
| | with gr.Tab("Dataset Information"): |
| | self._dataset_tab = DatasetTab() |
| | self._dataset_tab.build() |
| |
|
| | return demo |
| | |
| | def run(self): |
| | """Run the application.""" |
| | logger.info("Starting Mizan Turkish Leaderboard...") |
| | |
| | |
| | demo = self.build_interface() |
| | demo.launch( |
| | server_name="0.0.0.0", |
| | server_port=settings.ui.port, |
| | share=False |
| | ) |
| |
|
| |
|
| | def main(): |
| | """Main entry point.""" |
| | app = MizanApp() |
| | app.run() |
| |
|
| |
|
| | if __name__ == "__main__": |
| | main() |
| |
|