Text Classification
Laya
Safetensors
multilingual
mmbert
modernbert
decision-making
classification
routing
scoring
fp16
Instructions to use MigoXV/laya-multilingual with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Laya
How to use MigoXV/laya-multilingual with Laya:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
|
Download README.md from MigoXV/laya-multilingual: direct link, hf CLI and curl.
- Browser
- Download file 7.66 kB
-
https://huggingface.co/MigoXV/laya-multilingual/resolve/main/README.md
- Command line
-
hf download hf://MigoXV/laya-multilingual/README.md
-
curl -L -o README.md https://huggingface.co/MigoXV/laya-multilingual/resolve/main/README.md
7.66 kB
| license: apache-2.0 | |
| language: | |
| - multilingual | |
| base_model: convaiinnovations/laya | |
| pipeline_tag: text-classification | |
| tags: | |
| - laya | |
| - mmbert | |
| - modernbert | |
| - decision-making | |
| - classification | |
| - routing | |
| - scoring | |
| - safetensors | |
| - fp16 | |
| # Laya 多语言决策模型 | |
| 本仓库提供 Laya 的多语言检查点,使用 `jhu-clsp/mmBERT-base` 编码器和专用决策头,根据输入状态与问题返回选择、评分或命题成立概率。它适用于文本分类、工单路由、等级评估和条件判断,输出结构化决策结果,不生成自由文本。 | |
| 这是上游 `convaiinnovations/laya` 的 `multilingual/` 检查点的资源整理版本:**未重新训练、未量化、未转换权重**。权重和分词器保持原始字节;编码器、决策头和分词器等配置合并到根目录的 `config.json`,方便本地 Laya Runtime 加载。 | |
| ## 模型信息 | |
| | 项目 | 内容 | | |
| | --- | --- | | |
| | 编码器 | [jhu-clsp/mmBERT-base](https://huggingface.co/jhu-clsp/mmBERT-base) | | |
| | 编码器结构 | ModernBERT,22 层,隐藏维度 768,12 个注意力头 | | |
| | 词表大小 | 256,000 | | |
| | 决策头 | 2 层,2 个动作输出 | | |
| | 模型参数量 | 321,908,995(不含 3 个温度校准值) | | |
| | 权重格式 | Safetensors | | |
| | 存储精度 | 169 个 FP16 张量;`temperature` 张量为 FP32,形状 `[3]` | | |
| | 权重文件大小 | 643,835,514 字节,约 614 MiB | | |
| | 推理资源总大小 | 678,201,620 字节,约 647 MiB(配置、权重、分词器) | | |
| | 默认输入预算 | `max_len=1024`,`head_max_len=256` | | |
| | 编码器最大位置长度 | 8192;实际请求仍受 Runtime 的 1024 Token 预算限制 | | |
| | 校准参数 | 三类问题的 temperature 均为 1.0,无按选项数校准配置 | | |
| | 许可证 | Apache-2.0 | | |
| `config.json` 中 `encoder.dtype="float32"` 是保留的编码器配置元信息,**不代表权重文件是 FP32**。文件的实际 dtype 以 Safetensors 头信息为准;运行精度由 Runtime 的 `--dtype` 设置控制。 | |
| ## 决策类型 | |
| | 类型 | 输入要求 | 输出语义 | | |
| | --- | --- | --- | | |
| | `choice` | 2–16 个唯一选项,支持列表或标签到说明的映射 | 选中标签及选项概率分布 | | |
| | `score` | 2–16 个由低到高排列的等级说明 | 按从 0 开始的等级索引计算期望分数 | | |
| | `noul` | 判断命题;可提供 `false` / `true` 说明 | 命题成立的概率,范围为 0–1 | | |
| 以上请求约束对应配套本地 Runtime。一次请求可包含 1–16 个问题。上游将该检查点描述为多语言模型;本次发布未重新测量各语言或各领域的准确率。 | |
| ## 仓库文件 | |
| ```text | |
| laya-multilingual/ | |
| ├── config.json # format_version=1 的统一推理配置 | |
| ├── model.safetensors # 编码器、决策头及温度张量 | |
| ├── tokenizer.json # 分词器词表与规则 | |
| ├── manifest.json # 原始来源、整理方式、文件大小和 SHA-256 | |
| ├── LICENSE # Apache-2.0 许可证全文 | |
| └── README.md # 中文模型卡 | |
| ``` | |
| 推理只需 `config.json`、`model.safetensors` 和 `tokenizer.json`。统一配置包含 `encoder`、`decision_head`、`input_limits`、`calibration` 和 `tokenizer`;设备、监听地址、队列及超时由软件配置管理。 | |
| ## 下载 | |
| 安装 Hugging Face CLI 后执行: | |
| ```bash | |
| hf download MigoXV/laya-multilingual --local-dir ./laya-multilingual | |
| ``` | |
| 也可使用 Python API: | |
| ```python | |
| from huggingface_hub import snapshot_download | |
| model_dir = snapshot_download( | |
| repo_id="MigoXV/laya-multilingual", | |
| local_dir="./laya-multilingual", | |
| ) | |
| print(model_dir) | |
| ``` | |
| ## 使用配套 Laya Runtime | |
| 软件项目为 [MigoXV/laya](https://github.com/MigoXV/laya)。本仓库的 `config.json` 是该本地服务的统一资源格式,**需要支持 `format_version=1` 的 Runtime**,不能直接作为标准 Transformers 模型目录通过 `AutoModel.from_pretrained()` 或 `pipeline()` 加载。仅支持上游旧目录结构的 Runtime 也需要适配;本次发布仅包含模型资源,未同步发布软件代码。PyPI 上同名的 `laya` 包不等同于这里的本地项目。 | |
| 下面命令在已安装依赖、支持该格式的 Laya 项目目录中执行。项目使用 Python 3.10 和 Poetry,Torch 在同一虚拟环境中单独安装,安装版本请遵循所用 Runtime 的 README。 | |
| ```bash | |
| # 将路径替换成实际下载位置 | |
| poetry run laya inspect --model-dir /absolute/path/to/laya-multilingual | |
| # NVIDIA CUDA:FP16 推理 | |
| poetry run laya serve \ | |
| --model-dir /absolute/path/to/laya-multilingual \ | |
| --device cuda:0 --dtype fp16 | |
| # CPU:FP32 推理;与上面的服务二选一运行 | |
| poetry run laya serve \ | |
| --model-dir /absolute/path/to/laya-multilingual \ | |
| --device cpu --dtype fp32 | |
| ``` | |
| 默认服务端口为 `10002`。启动后提交请求: | |
| ```bash | |
| curl http://127.0.0.1:10002/v1/decisions \ | |
| -H 'Content-Type: application/json' \ | |
| -d '{ | |
| "state": "小李负责测试,小王负责发布。", | |
| "questions": { | |
| "owner": { | |
| "type": "choice", | |
| "instructions": "谁负责测试?", | |
| "criteria": ["小李", "小王"] | |
| }, | |
| "assignment": { | |
| "type": "noul", | |
| "instructions": "小王是否负责发布?" | |
| } | |
| } | |
| }' | |
| ``` | |
| 如需离线命令行推理,将同样的请求 JSON 保存为 `request.json`: | |
| ```bash | |
| poetry run laya infer request.json \ | |
| --model-dir /absolute/path/to/laya-multilingual \ | |
| --device cpu --dtype fp32 | |
| ``` | |
| 模型目录不包含需要执行的 Python 文件。Runtime 负责构造编码器和决策头、加载权重、组织问题与选项输入,以及计算结果。 | |
| ## 精度与使用限制 | |
| - FP16 权重占用不等于运行时总显存,激活、CUDA 上下文和框架还会占用资源;FP32 执行会增加参数内存。 | |
| - 配套 Runtime 的 FP16 执行要求 CUDA;CPU 使用 FP32。FP16 和 FP32 的概率与 logits 可能存在数值差异。 | |
| - 当前工作区在 PyTorch 2.9.1 / Transformers 4.57.6 下的 FP16 验证尚未通过原有严格数值对齐门槛。本模型卡不宣称 FP16 与 FP32 完全一致,也不承诺 FP16 必然更快。 | |
| - 当前配置的完整序列预算为 1024 Token,问题和选项相关预算为 256 Token;Token 数并非字符数。配套 Runtime 对超长输入报错,不静默截断。 | |
| - `confidence` 表示分布集中度,不等于准确率;当前配置未提供额外拟合的温度校准。领域准确率、概率可靠性和决策阈值需要用目标数据验证。 | |
| - 本次发布没有新增训练、评测或性能基准;不把上游宣传的语言覆盖、延迟或校准效果作为本版本的独立验证结果。 | |
| ## 来源、整理与许可证 | |
| 原始仓库:[convaiinnovations/laya](https://huggingface.co/convaiinnovations/laya)。固定来源快照为 [`55cf4c4ebb4ebe31b2550e8bdf3bd21b99753851` 的 multilingual 子目录](https://huggingface.co/convaiinnovations/laya/tree/55cf4c4ebb4ebe31b2550e8bdf3bd21b99753851/multilingual)。原作者和训练方法说明见[该快照的上游模型卡](https://huggingface.co/convaiinnovations/laya/blob/55cf4c4ebb4ebe31b2550e8bdf3bd21b99753851/README.md)。 | |
| 整理工作包括合并推理配置、移除不参与推理的训练字段、将 `tokenizer.json` 放到根目录、附上中文说明与来源清单。权重和分词器保持原始字节。核心文件的 SHA-256 已与 `manifest.json` 核对一致,可用清单追溯发布内容。 | |
| 本模型沿用上游声明的 **Apache-2.0** 许可证,全文见 [LICENSE](LICENSE)。本仓库为上游多语言检查点的整理发布,不表示重新训练或由发布账号原创。 | |