MaziyarPanahi's picture
Upload MLX packaging for OpenMed-PII-Telugu-BigMed-Large-278M-v1-mlx
cf28f67 verified
|
Raw
History Blame
3.68 kB
---
license: apache-2.0
base_model: OpenMed/OpenMed-PII-Telugu-BigMed-Large-278M-v1
pipeline_tag: token-classification
library_name: openmed
tags:
- openmed
- mlx
- apple-silicon
- token-classification
- pii
- de-identification
- medical
- clinical
---
# OpenMed-PII-Telugu-BigMed-Large-278M-v1 for OpenMed MLX
This repository contains a **private MLX packaging** of [`OpenMed/OpenMed-PII-Telugu-BigMed-Large-278M-v1`](https://huggingface.co/OpenMed/OpenMed-PII-Telugu-BigMed-Large-278M-v1) for Apple Silicon inference with [**OpenMed**](https://github.com/maziyarpanahi/openmed).
[OpenMed](https://github.com/maziyarpanahi/openmed) is the main product experience:
- Install the Python package with `pip install openmed`
- Enable Apple Silicon acceleration with `pip install "openmed[mlx]"`
- Run the same OpenMed API you already use, now backed by MLX on macOS
- For Apple apps, use **OpenMedKit** from the same GitHub repository with a CoreML bundle
This MLX repo is meant to pair with:
- OpenMed GitHub: [https://github.com/maziyarpanahi/openmed](https://github.com/maziyarpanahi/openmed)
- OpenMed website: [https://openmed.life](https://openmed.life)
- Source checkpoint: [`OpenMed/OpenMed-PII-Telugu-BigMed-Large-278M-v1`](https://huggingface.co/OpenMed/OpenMed-PII-Telugu-BigMed-Large-278M-v1)
## Quick Start
### Python
```bash
pip install openmed
pip install "openmed[mlx]"
```
```python
from openmed import analyze_text
from openmed.core.config import OpenMedConfig
result = analyze_text(
"Patient John Doe, DOB 1990-05-15, SSN 123-45-6789",
model_name="OpenMed/OpenMed-PII-Telugu-BigMed-Large-278M-v1",
config=OpenMedConfig(backend="mlx"),
)
for entity in result.entities:
print(entity.label, entity.text, round(entity.confidence, 4))
```
You can use the source model ID directly through OpenMed, or download this private MLX packaging from [`OpenMed/OpenMed-PII-Telugu-BigMed-Large-278M-v1-mlx`](https://huggingface.co/OpenMed/OpenMed-PII-Telugu-BigMed-Large-278M-v1-mlx) for a preconverted path.
### Swift
Use Swift with **OpenMedKit**, not with MLX weight files directly.
1. Open Xcode and go to **File > Add Package Dependencies...**
2. Paste the OpenMed repository URL:
`https://github.com/maziyarpanahi/openmed`
3. Choose the package product **OpenMedKit** from the repository.
4. Add a compatible CoreML model bundle plus `id2label.json` to your app target.
After that, import OpenMedKit in Swift:
```swift
import OpenMedKit
```
Then load your bundled CoreML model and label map:
```swift
import Foundation
import OpenMedKit
let modelFolder = Bundle.main.resourceURL!
let modelURL = modelFolder.appendingPathComponent("OpenMedPII.mlmodelc")
let labelsURL = modelFolder.appendingPathComponent("id2label.json")
let openmed = try OpenMed(
modelURL: modelURL,
id2labelURL: labelsURL
)
```
This private MLX artifact remains the right choice for:
- Python services on Apple Silicon
- local MLX inference on macOS
- private preconverted packaging on the Hub
If a given architecture or environment cannot be exported cleanly as `safetensors`, OpenMed falls back to `weights.npz` so the model remains usable.
## Credits
- Base checkpoint: [`OpenMed/OpenMed-PII-Telugu-BigMed-Large-278M-v1`](https://huggingface.co/OpenMed/OpenMed-PII-Telugu-BigMed-Large-278M-v1)
- OpenMed GitHub: [https://github.com/maziyarpanahi/openmed](https://github.com/maziyarpanahi/openmed)
- OpenMed website: [https://openmed.life](https://openmed.life)
- MLX packaging and runtime support: [**OpenMed**](https://github.com/maziyarpanahi/openmed)
- Swift runtime for Apple apps: **OpenMedKit** from the OpenMed repository