Spaces:
Sleeping
Sleeping
| """ | |
| DeepText Studio | |
| Multi-Task NLP Toolkit 路 ISEN M1 S8 | |
| Point d'entr茅e principal de l'application Gradio. | |
| """ | |
| import gradio as gr | |
| from ui.theme import create_theme, CUSTOM_CSS | |
| from ui.tab_tokenizer import create_tab as create_tokenizer_tab | |
| from ui.tab_sentiment import create_tab as create_sentiment_tab | |
| from ui.tab_similarity import create_tab as create_similarity_tab | |
| from ui.tab_zero_shot import create_tab as create_zero_shot_tab | |
| from ui.tab_innovation import create_tab as create_innovation_tab | |
| from ui.tab_settings import create_tab as create_settings_tab | |
| # R茅duire les warnings des mod猫les (UNEXPECTED keys) | |
| import warnings | |
| import logging | |
| warnings.filterwarnings("ignore", message=".*UNEXPECTED.*") | |
| logging.getLogger("transformers.modeling_utils").setLevel(logging.ERROR) | |
| def build_app() -> gr.Blocks: | |
| """Construit et retourne l'application Gradio compl猫te.""" | |
| with gr.Blocks( | |
| title="DeepText Studio - NLP Toolkit", | |
| ) as app: | |
| # Header | |
| gr.HTML(""" | |
| <div class="app-header"> | |
| <h1>DeepText Studio</h1> | |
| <p>Multi-Task NLP Toolkit - Tokenization 路 Sentiment 路 Similarity 路 Classification 路 NER</p> | |
| </div> | |
| """) | |
| # Tabs NLP | |
| with gr.Tabs(): | |
| create_tokenizer_tab() | |
| create_sentiment_tab() | |
| create_similarity_tab() | |
| create_zero_shot_tab() | |
| create_innovation_tab() | |
| create_settings_tab() | |
| return app | |
| if __name__ == "__main__": | |
| import os | |
| theme = create_theme() | |
| app = build_app() | |
| is_spaces = os.environ.get("SPACE_ID") is not None | |
| app.launch( | |
| server_name="0.0.0.0" if is_spaces else "127.0.0.1", | |
| server_port=7860, | |
| share=False, | |
| show_error=True, | |
| ssr_mode=False, | |
| theme=theme, | |
| css=CUSTOM_CSS, | |
| ) | |