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/.env.example from x6nux/laya-ad: direct link, hf CLI and curl.
- Browser
- Download file 712 Bytes
-
https://huggingface.co/x6nux/laya-ad/resolve/main/code/laya-server/.env.example
- Command line
-
hf download hf://x6nux/laya-ad/code/laya-server/.env.example
-
curl -L -o .env.example https://huggingface.co/x6nux/laya-ad/resolve/main/code/laya-server/.env.example
712 Bytes
| # Copy to .env and fill in the values below. Keep .env out of Git. | |
| LAYA_ADMIN_USERNAME=admin | |
| # Set a password of at least 10 characters, or use LAYA_ADMIN_PASSWORD_HASH instead. | |
| LAYA_ADMIN_PASSWORD='' | |
| # LAYA_ADMIN_PASSWORD_HASH='$argon2id$...' | |
| LAYA_SESSION_HOURS=12 | |
| # LAYA_DEVICE=cpu | |
| # ad-clf CPU 优化(可选;默认物理核数 ≈ 逻辑核一半) | |
| # LAYA_CPU_THREADS=8 | |
| # LAYA_AD_BATCH=32 | |
| # LAYA_AD_BATCH_WINDOW_MS=15 | |
| # 模型下载(镜像不带权重;首次启动从 HF 自动下载) | |
| # 镜像站可选 https://hf-mirror.com | |
| # LAYA_HF_ENDPOINT=https://huggingface.co | |
| # LAYA_HF_REPO=x6nux/laya-ad | |
| # LAYA_MODEL_VERSION=v2.2 | |
| # LAYA_MODEL_PRECISION=fp8 | |
| # LAYA_PRELOAD=fp8,int4 | |
| # LAYA_AUTO_DOWNLOAD=1 | |