Instructions to use masahiroid/mdeberta-v3-base-mlx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use masahiroid/mdeberta-v3-base-mlx with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] hf download masahiroid/mdeberta-v3-base-mlx --local-dir mdeberta-v3-base-mlx
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
Add Japanese translation (.ja.md)
Browse files- README.ja.md +55 -0
- README.md +2 -0
- SECURITY.ja.md +5 -0
- SECURITY.md +2 -0
README.ja.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# mdeberta-v3-base — MLX
|
| 2 |
+
|
| 3 |
+
[English version here (README.md)](README.md)
|
| 4 |
+
|
| 5 |
+
多言語のベースエンコーダーです。トークンごとの隠れ状態を返します。タスク用のヘッドは追加していません。実際のタスクに使うには、別途ファインチューニングが必要です。
|
| 6 |
+
|
| 7 |
+
[microsoft/mdeberta-v3-base](https://huggingface.co/microsoft/mdeberta-v3-base/tree/a0484667b22365f84929a935b5e50a51f71f159d)(リビジョン`a0484667b22365f84929a935b5e50a51f71f159d`)を変換したものです。ファインチューニングや、別のチェックポイントへの置き換えはしていません。F32のベースラインで、**4ビット量子化ではありません**。クレジットとライセンス上の権利は元の作者にあります。
|
| 8 |
+
|
| 9 |
+
## 使い方と互換性
|
| 10 |
+
|
| 11 |
+
MLXでネイティブに実装したもので、テンソル名は元の推論モデルのものをそのまま使っています。この独自ランタイムは、mlx-lmのテキスト生成モデルではありません。
|
| 12 |
+
|
| 13 |
+
同梱のMLXランタイムには、Apple Silicon搭載のMacが必要です。入力の長さは可変です(元モデルの上限まで)。下記のコンパイル済みApple向け書き出しは、固定の形状を使います。
|
| 14 |
+
|
| 15 |
+
```bash
|
| 16 |
+
pip install huggingface_hub mlx numpy transformers sentencepiece
|
| 17 |
+
```
|
| 18 |
+
|
| 19 |
+
```python
|
| 20 |
+
from huggingface_hub import snapshot_download
|
| 21 |
+
from pathlib import Path
|
| 22 |
+
import sys, numpy as np
|
| 23 |
+
path = snapshot_download("masahiroid/mdeberta-v3-base-mlx")
|
| 24 |
+
sys.path.insert(0, path)
|
| 25 |
+
from runtime_mlx import Model
|
| 26 |
+
model = Model(path)
|
| 27 |
+
from transformers import AutoTokenizer
|
| 28 |
+
tok = AutoTokenizer.from_pretrained(path, use_fast=False)
|
| 29 |
+
inputs = tok("Thank you so much!", return_tensors="np", truncation=True, max_length=128)
|
| 30 |
+
output = model(input_ids=inputs["input_ids"], attention_mask=inputs["attention_mask"])
|
| 31 |
+
print(np.array(output).shape)
|
| 32 |
+
```
|
| 33 |
+
|
| 34 |
+
## 数値検証
|
| 35 |
+
|
| 36 |
+
元のPyTorch実装と、決定的な6ケースで比較しました。出力の絶対差の最大値は**0.0010339618**、コサイン類似度の最小値は**0.99999876**です。各ケースは`validation.json`を見てください。これは変換前後の一致を確かめるチェックで、タスク性能やレイテンシーを測る本格的なベンチマークではありません。
|
| 37 |
+
|
| 38 |
+
テキスト向けのテストは、英語の感情表現、中立的な検索用テキスト、日本語、空の入力、切り詰めを扱います。Chronos向けのテストは、トレンドと正弦波の合成、一定の系列、欠測を含む系列を扱います。各モデルには、当てはまるテストだけを使っています。
|
| 39 |
+
|
| 40 |
+
Core ML/Core AIのテキスト向け書き出しは、バッチ1、系列長128です。トークン化では128にパディング/切り詰めをしてください。ChronosのApple向け書き出しは、バッチ1、コンテキスト長2048です。MLX/独自GGUFは、追加の学習をせず、元の最大コンテキストをそのまま保っています。固定形状のApple向け書き出しでは、短いChronos入力の左側をNaNで埋められます。予測期間は64のままです。
|
| 41 |
+
|
| 42 |
+
## 再現性
|
| 43 |
+
|
| 44 |
+
元モデルのリビジョンと出力の意味は`provenance.json`に記載しています。変換スクリプトも同梱しています。再現するときは、スクリプトと同じように`sources/<original-model-name>/`、`sources.json`、`publish/`の各ディレクトリーを置いたチェックアウトで実行してください。PyTorch 2.14.1、Transformers 4.57.3、MLX 0.32.4、NumPy 1.26.4(MLX/Core ML環境)、coremltools 9.0、chronos-forecasting 2.3.2、GGUF 0.19.0を使いました。Core AIの書き出しにはcoreai-torch 0.4.3を使っています。Core AIの検証は、別のPython 3.14環境で行いました。検証した環境以外でのバージョン互換性は保証しません。
|
| 45 |
+
|
| 46 |
+
## ライセンス
|
| 47 |
+
|
| 48 |
+
重みのライセンスは元のまま**mit**です。元モデルの条件は`LICENSE`にあります。変換・ランタイム用に追加したコードはMITライセンスです(`CODE_LICENSE`)。新しいタスク学習、安全性の認証、商用ライセンスを示すものではありません。
|
| 49 |
+
|
| 50 |
+
## その他の形式
|
| 51 |
+
|
| 52 |
+
- [mlx](https://huggingface.co/masahiroid/mdeberta-v3-base-mlx)
|
| 53 |
+
- [coreml](https://huggingface.co/masahiroid/mdeberta-v3-base-coreml)
|
| 54 |
+
- [coreai](https://huggingface.co/masahiroid/mdeberta-v3-base-coreai)
|
| 55 |
+
- [gguf](https://huggingface.co/masahiroid/mdeberta-v3-base-gguf)
|
README.md
CHANGED
|
@@ -7,6 +7,8 @@ tags:
|
|
| 7 |
---
|
| 8 |
# mdeberta-v3-base — MLX
|
| 9 |
|
|
|
|
|
|
|
| 10 |
Multilingual base encoder. Returns token-level hidden states. No task head was added; downstream fine-tuning is still needed.
|
| 11 |
|
| 12 |
Conversion of [microsoft/mdeberta-v3-base](https://huggingface.co/microsoft/mdeberta-v3-base/tree/a0484667b22365f84929a935b5e50a51f71f159d) at revision `a0484667b22365f84929a935b5e50a51f71f159d`. No fine-tuning or replacement checkpoint. F32 baseline, **not a 4-bit quantization**. Original authors retain credit and license rights.
|
|
|
|
| 7 |
---
|
| 8 |
# mdeberta-v3-base — MLX
|
| 9 |
|
| 10 |
+
[日本語版はこちら (README.ja.md)](README.ja.md)
|
| 11 |
+
|
| 12 |
Multilingual base encoder. Returns token-level hidden states. No task head was added; downstream fine-tuning is still needed.
|
| 13 |
|
| 14 |
Conversion of [microsoft/mdeberta-v3-base](https://huggingface.co/microsoft/mdeberta-v3-base/tree/a0484667b22365f84929a935b5e50a51f71f159d) at revision `a0484667b22365f84929a935b5e50a51f71f159d`. No fine-tuning or replacement checkpoint. F32 baseline, **not a 4-bit quantization**. Original authors retain credit and license rights.
|
SECURITY.ja.md
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 配布物の監査
|
| 2 |
+
|
| 3 |
+
[English version here (SECURITY.md)](SECURITY.md)
|
| 4 |
+
|
| 5 |
+
pickle形式のチェックポイントは含みません。モデルのテンソルは、safetensors、Core MLパッケージ、Core AIアセット、GGUFのいずれかで保存しています。同梱のPythonコードはローカルで実行されます。実行する前に中身を確認してください。リモートコードの自動読み込みは必要ありません。ファイルとハッシュは`SHA256SUMS.json`にあります。チェックサムは意図しない変更を見つけるためのもので、安全であることの証明にはなりません。これは変換の数値チェックであり、攻撃を想定した安全性評価ではありません。
|
SECURITY.md
CHANGED
|
@@ -1,3 +1,5 @@
|
|
| 1 |
# Distribution audit
|
| 2 |
|
|
|
|
|
|
|
| 3 |
No pickle checkpoints are included. Model tensors are stored in safetensors, a Core ML package, a Core AI asset or GGUF. Included Python code executes locally; review it before running. No automatic remote-code loading is required. Files and hashes: `SHA256SUMS.json`. Checksums detect accidental changes; they are not proof of safety. This is a numerical conversion check, not an adversarial safety evaluation.
|
|
|
|
| 1 |
# Distribution audit
|
| 2 |
|
| 3 |
+
[日本語版はこちら (SECURITY.ja.md)](SECURITY.ja.md)
|
| 4 |
+
|
| 5 |
No pickle checkpoints are included. Model tensors are stored in safetensors, a Core ML package, a Core AI asset or GGUF. Included Python code executes locally; review it before running. No automatic remote-code loading is required. Files and hashes: `SHA256SUMS.json`. Checksums detect accidental changes; they are not proof of safety. This is a numerical conversion check, not an adversarial safety evaluation.
|