import gradio as gr from transformers import pipeline # Initialize the classifier pipeline classifier = pipeline("text-classification", model="rahbi/alclam-base-v1-DID") # Define the prediction function def classify_text(text): result = classifier(text) return result # Create the Gradio interface iface = gr.Interface( fn=classify_text, inputs="text", outputs="json", title="Arabic Text Classifier", description="Classify Arabic text using the rahbi/alclam-base-v1-DID model." ) # Launch the interface iface.launch()