import gradio as gr from transformers import pipeline # Load the model directly from your Hugging Face account classifier = pipeline("text-classification", model="jay123jay/AI-Text-Origin-Classifier", truncation=True, max_length=512, top_k=None) def detect_text(text): if not text.strip(): return {} results = classifier(text) # Use [ 0 ] to extract the dictionary from the nested list inner_results = results[ 0 ] return {res['label']: res['score'] for res in inner_results} class_intro_html = "