Text Classification
Transformers
Safetensors
Chinese
spam-detection
advertising-detection
ad-classification
chinese
modernbert
mmbert
multi-task
four-head
Instructions to use x6nux/laya-ad with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use x6nux/laya-ad with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="x6nux/laya-ad")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("x6nux/laya-ad", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download code/laya-server/scripts/dev-backend.sh from x6nux/laya-ad: direct link, hf CLI and curl.
- Browser
- Download file 924 Bytes
-
https://huggingface.co/x6nux/laya-ad/resolve/main/code/laya-server/scripts/dev-backend.sh
- Command line
-
hf download hf://x6nux/laya-ad/code/laya-server/scripts/dev-backend.sh
-
curl -L -o dev-backend.sh https://huggingface.co/x6nux/laya-ad/resolve/main/code/laya-server/scripts/dev-backend.sh
924 Bytes
| set -eu | |
| cd "$(dirname "$0")/.." | |
| if [ ! -f .env ]; then | |
| echo 'Missing .env. Copy .env.example to .env and set the administrator password.' >&2 | |
| exit 1 | |
| fi | |
| if [ ! -x .venv/bin/uvicorn ]; then | |
| echo 'Missing .venv. Install the backend dependencies described in README.md.' >&2 | |
| exit 1 | |
| fi | |
| set -a | |
| . ./.env | |
| set +a | |
| if [ -z "${LAYA_ADMIN_PASSWORD:-}" ] && [ -z "${LAYA_ADMIN_PASSWORD_HASH:-}" ]; then | |
| echo 'Set LAYA_ADMIN_PASSWORD or LAYA_ADMIN_PASSWORD_HASH in .env before starting the backend.' >&2 | |
| exit 1 | |
| fi | |
| # Vite proxies /internal and /v1 to this backend during local development. | |
| export LAYA_DATABASE_PATH=./data/laya.sqlite3 | |
| export LAYA_MODEL_DIR=./models | |
| export LAYA_DEVICE="${LAYA_DEVICE:-cpu}" | |
| export HF_HOME=./models/.cache | |
| export LAYA_FRONTEND_DIR=./frontend/dist | |
| exec .venv/bin/uvicorn server.main:app --host 127.0.0.1 --port 8000 --reload --reload-dir backend/server | |