Flask microservice exposing MayZhou/e5-small-lora-ai-generated-detector via a simple HTTP API.
Files
e5-small-lora.py: the Flask app exposing /health and /classify.test_e5_client.py: small client to send text and print AI/Human scores.Python packages
pip install flask torch transformers huggingface_hub requests
Optional environment variables
HF_TOKEN — if the model requires authentication.AI_SCORE_API_URL — not used directly here; consumed by the Similarity service.Model cache
models/e5_small_lora_ai_detector/ at repository root.GET /health
{ "status": "ok", "device": "cpu|cuda", "model_dir": "..." }POST /classify
{ "text": "..." }{ "ai_score": 0..1 } where 1.0 = very likely AI-generated.python e5-small-lora.py
# Service listens on 0.0.0.0:5001
python test_e5_client.py --url http://localhost:5001/classify --text "Sample text"
Flask microservice exposing MayZhou/e5-small-lora-ai-generated-detector via a simple HTTP API.
Files
e5-small-lora.py: the Flask app exposing /health and /classify.test_e5_client.py: small client to send text and print AI/Human scores.Python packages
pip install flask torch transformers huggingface_hub requests
Optional environment variables
HF_TOKEN — if the model requires authentication.AI_SCORE_API_URL — not used directly here; consumed by the Similarity service.Model cache
models/e5_small_lora_ai_detector/ at repository root.GET /health
{ "status": "ok", "device": "cpu|cuda", "model_dir": "..." }POST /classify
{ "text": "..." }{ "ai_score": 0..1 } where 1.0 = very likely AI-generated.python e5-small-lora.py
# Service listens on 0.0.0.0:5001
python test_e5_client.py --url http://localhost:5001/classify --text "Sample text"