Moodmapper / app.py
zuch95's picture
Update app.py
70a269f verified
raw
history blame
368 Bytes
import gradio as gr
from transformers import pipeline
APP_NAME = "MoodMapper"
MODEL_ID = "j-hartmann/emotion-english-distilroberta-base"
_clf = None
def get_clf():
"""Charge le modèle une seule fois pour éviter les ralentissements."""
global _clf
if _clf is None:
_clf = pipeline(
"text-classification",
model=MODEL_ID,