Spaces:
Build error
Build error
Update app.py
Browse files1234456786 unmodified lines1516171718192021222223242526import gradio as grfrom transformers import pipeline
# Use a stable, supported modelclf = pipeline("text-classification", model="MayZhou/e5-small-lora-ai-generated-detector")clf = pipeline("text-classification", model="roberta-base-openai-detector")
def detect_ai(text): if not text.strip():6 unmodified lines except Exception as e: return f"Error: {str(e)}"
# Launch the app with a basic Gradio Interface (exposes /predict endpoint)# Simple Interface to expose API at /api/predict/demo = gr.Interface( fn=detect_ai, inputs=gr.Textbox(lines=4, label="Enter text"), outputs="text", title="AI Text Detector", title="AI Text Detector")
demo.launch()app.py+4-3