Swift Core ML implementations of Transformer models
Top 25.9% on sourcepulse
This repository provides Swift implementations of popular transformer models (GPT-2, BERT, DistilBERT) for on-device inference using Core ML 3. It targets iOS and macOS developers looking to integrate advanced natural language processing capabilities into their applications without relying on cloud services.
How It Works
The project converts PyTorch-trained models from the Hugging Face transformers
library into the Core ML 3 format. It includes Swift implementations of tokenizers (WordPiece, Byte-Pair Encoding) and necessary utilities for tasks like question answering (SQuAD dataset) and text generation. The core advantage is enabling efficient, offline execution of these powerful NLP models on Apple hardware.
Quick Start & Requirements
git-lfs
for downloading model files.Highlighted Details
Maintenance & Community
This repository is not actively maintained and has been archived. Users are directed to swift-transformers
for an in-development replacement.
Licensing & Compatibility
The license is not explicitly stated in the README. Given the association with Hugging Face and Apple, it's likely permissive, but users should verify for commercial use.
Limitations & Caveats
The project is archived and no longer actively maintained, indicating potential issues with compatibility with newer Swift or Core ML versions. The README explicitly states it is not actively maintained.
1 year ago
Inactive