Spaces:
Build error
Build error
Update app.py
Browse files12345676 unmodified lines141516171819202122232425import gradio as grfrom transformers import pipelineclf = pipeline("text-classification", model="MayZhou/e5-small-lora-ai-generated-detector")def detect_ai(text):if not text.strip():6 unmodified linesexcept Exception as e:return f"Error: {str(e)}"# Launch the app with a basic Gradio Interface (exposes /predict endpoint)demo = gr.Interface(fn=detect_ai,inputs=gr.Textbox(lines=4, label="Enter text"),outputs="text",title="AI Text Detector",)demo.launch()123456786 unmodified lines151617181920212223242526import gradio as grfrom transformers import pipeline# Use a stable, supported modelclf = pipeline("text-classification", model="roberta-base-openai-detector")def detect_ai(text):if not text.strip():6 unmodified linesexcept Exception as e:return f"Error: {str(e)}"# 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")demo.launch()
app.py+4-3