Text Classification
Transformers
Laya
English
multilingual
typed-decisions
non-autoregressive
axera
ax650
Instructions to use AXERA-TECH/Laya with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AXERA-TECH/Laya with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="AXERA-TECH/Laya")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("AXERA-TECH/Laya", device_map="auto") - Laya
How to use AXERA-TECH/Laya 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
yongqiang commited on
Commit ·
25aeab7
1
Parent(s): c0ee15b
Update demo device label
Browse files- SHA256SUMS +3 -3
- demo/README.md +3 -3
- demo/app.py +3 -3
- demo/backend.py +1 -1
SHA256SUMS
CHANGED
|
@@ -22,8 +22,8 @@ b5fd1aa76978b0ed9ed066967d2de34721dafb46c82cb907f6ce7cc13175fbd4 typed-decision
|
|
| 22 |
81c06e9762bfaac9e7898fcdf74712d60d134d099ab5e7cf7bbd498ce9f597f1 python/ax650/requirements.txt
|
| 23 |
6c7a11b63b2c2b0a7498ade91669751e64c52266b00eb159bf9a4f31e83d8de3 python/pytorch/infer.py
|
| 24 |
9530bd8e4e25e3a2b5729db2daf7c2f540504fd413b619f1a17f81d0daf26457 python/pytorch/requirements.txt
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
cafdd16bddc88c09575a80b3d05070a9a50c23bb028cebc0a24e4dbd745ae587 demo/requirements.txt
|
| 29 |
d33abce0f58d3bbe1f07d4ab53c12081d015d2e79dbc5d12b79903fa6d43459a demo/scenarios.py
|
|
|
|
| 22 |
81c06e9762bfaac9e7898fcdf74712d60d134d099ab5e7cf7bbd498ce9f597f1 python/ax650/requirements.txt
|
| 23 |
6c7a11b63b2c2b0a7498ade91669751e64c52266b00eb159bf9a4f31e83d8de3 python/pytorch/infer.py
|
| 24 |
9530bd8e4e25e3a2b5729db2daf7c2f540504fd413b619f1a17f81d0daf26457 python/pytorch/requirements.txt
|
| 25 |
+
be080e421685493cebbe66a37fcc892effcbc4639c38a0dded0470b50e58a126 demo/README.md
|
| 26 |
+
c03ca1001d245a1a70b62388c01dd05b011a1debf67cd31ee667bc78f66dd2f4 demo/app.py
|
| 27 |
+
7eddf60f719aeeac7e1f3ba0664f68e50a4c0e885ad2776362caf51bc033afbd demo/backend.py
|
| 28 |
cafdd16bddc88c09575a80b3d05070a9a50c23bb028cebc0a24e4dbd745ae587 demo/requirements.txt
|
| 29 |
d33abce0f58d3bbe1f07d4ab53c12081d015d2e79dbc5d12b79903fa6d43459a demo/scenarios.py
|
demo/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
-
# Laya
|
| 2 |
|
| 3 |
-
This demo adapts the interaction patterns and scenario templates from the Apache-2.0 licensed [upstream Laya Space](https://huggingface.co/spaces/convaiinnovations/laya-demo) and replaces its PyTorch backend with the packaged
|
| 4 |
|
| 5 |
## Install on the board
|
| 6 |
|
| 7 |
-
Install the
|
| 8 |
|
| 9 |
```bash
|
| 10 |
source .venv-ax650/bin/activate
|
|
|
|
| 1 |
+
# Laya AX8850 Gradio demo
|
| 2 |
|
| 3 |
+
This demo adapts the interaction patterns and scenario templates from the Apache-2.0 licensed [upstream Laya Space](https://huggingface.co/spaces/convaiinnovations/laya-demo) and replaces its PyTorch backend with the packaged AX8850 models through PyAXEngine.
|
| 4 |
|
| 5 |
## Install on the board
|
| 6 |
|
| 7 |
+
Install the AX8850 Python runtime first as described in `python/README.md`, including an `axengine` wheel. Then install Gradio:
|
| 8 |
|
| 9 |
```bash
|
| 10 |
source .venv-ax650/bin/activate
|
demo/app.py
CHANGED
|
@@ -188,14 +188,14 @@ CSS = """
|
|
| 188 |
"""
|
| 189 |
|
| 190 |
|
| 191 |
-
with gr.Blocks(title="Laya on
|
| 192 |
gr.HTML(
|
| 193 |
-
"<div class='hero'><h1>Laya Decision Engine ·
|
| 194 |
"<p>输入文本或 JSON,直接得到 choice、score 和 noul 类型化决策。"
|
| 195 |
"无文本生成,无需解析自然语言回答。</p></div>"
|
| 196 |
)
|
| 197 |
gr.Markdown(
|
| 198 |
-
f"**{STARTUP_STATUS}** ·
|
| 199 |
"概率用于演示模型信号;生产自动化阈值需要使用业务数据校准。"
|
| 200 |
)
|
| 201 |
|
|
|
|
| 188 |
"""
|
| 189 |
|
| 190 |
|
| 191 |
+
with gr.Blocks(title="Laya on AX8850") as demo:
|
| 192 |
gr.HTML(
|
| 193 |
+
"<div class='hero'><h1>Laya Decision Engine · AX8850</h1>"
|
| 194 |
"<p>输入文本或 JSON,直接得到 choice、score 和 noul 类型化决策。"
|
| 195 |
"无文本生成,无需解析自然语言回答。</p></div>"
|
| 196 |
)
|
| 197 |
gr.Markdown(
|
| 198 |
+
f"**{STARTUP_STATUS}** · AX8850/NPU3 · PyAXEngine · B1/S256/K4 \n"
|
| 199 |
"概率用于演示模型信号;生产自动化阈值需要使用业务数据校准。"
|
| 200 |
)
|
| 201 |
|
demo/backend.py
CHANGED
|
@@ -138,7 +138,7 @@ def result_cards(result: Dict[str, Any]) -> str:
|
|
| 138 |
header = (
|
| 139 |
"<div class='runtime-strip'>"
|
| 140 |
f"<span><b>{html.escape(result.get('model', 'Laya'))}</b></span>"
|
| 141 |
-
"<span>PyAXEngine ·
|
| 142 |
f"<span>NPU calls {total:.2f} ms</span>"
|
| 143 |
f"<span>request {wall:.2f} ms</span>"
|
| 144 |
"</div>"
|
|
|
|
| 138 |
header = (
|
| 139 |
"<div class='runtime-strip'>"
|
| 140 |
f"<span><b>{html.escape(result.get('model', 'Laya'))}</b></span>"
|
| 141 |
+
"<span>PyAXEngine · AX8850/NPU3</span>"
|
| 142 |
f"<span>NPU calls {total:.2f} ms</span>"
|
| 143 |
f"<span>request {wall:.2f} ms</span>"
|
| 144 |
"</div>"
|