CoolFace
Modelpublic

OpenMed/OpenMed-ZeroShot-NER-Genomic-Medium-209M-mlx

sourceHugging Faceapache-2.0updated 20d agoView on Hugging Face
0likes41downloads
Model Card

OpenMed-ZeroShot-NER-Genomic-Medium-209M for OpenMed MLX

This repository contains an OpenMed MLX conversion of `OpenMed/OpenMed-ZeroShot-NER-Genomic-Medium-209M` for Apple Silicon inference with OpenMed.

Artifact metadata:

  • OpenMed MLX task: zero-shot-ner
  • OpenMed MLX family: gliner-uni-encoder-span
  • Weight format: safetensors
  • Runtime API: GLiNERMLXPipeline

OpenMed MLX Status

Use This MLX Snapshot

Download this OpenMed MLX artifact directly from the Hub:

bash
hf download OpenMed/OpenMed-ZeroShot-NER-Genomic-Medium-209M-mlx --local-dir ./OpenMed-ZeroShot-NER-Genomic-Medium-209M-mlx

Use the downloaded directory when you want to pin this exact MLX artifact in an offline or local Apple Silicon workflow.

Quick Start

bash
pip install openmed
pip install "openmed[mlx]"
python
from huggingface_hub import snapshot_download
from openmed.mlx.inference import GLiNERMLXPipeline

model_path = snapshot_download("OpenMed/OpenMed-ZeroShot-NER-Genomic-Medium-209M-mlx")
pipe = GLiNERMLXPipeline(model_path)

entities = pipe.predict_entities(
    "Patient John Doe was seen at Stanford Hospital.",
    labels=["person", "organization", "location"],
    threshold=0.5,
)

for entity in entities:
    print(entity)

Prompt packing metadata included with the model:

json
{
  "kind": "gliner-words",
  "entity_token": "<<ENT>>",
  "separator_token": "<<SEP>>",
  "class_token_index": 128002,
  "embed_marker_token": true,
  "split_mode": "words"
}

Swift and Apple Apps

Use Swift with OpenMedKit, not with MLX weight files directly.

  1. 1.Open Xcode and go to File > Add Package Dependencies.
  2. 2.Paste the OpenMed repository URL: https://github.com/maziyarpanahi/openmed
  3. 3.Choose the package product OpenMedKit from the repository.
  4. 4.Add a compatible CoreML model bundle plus id2label.json to your app target.

This MLX model is for Python services on Apple Silicon, local MLX inference on macOS, and Hub-hosted model distribution. If a given environment cannot write weights.safetensors, OpenMed falls back to weights.npz so the model remains usable.

Credits