You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-23Lines changed: 9 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,16 +14,17 @@
14
14
15
15
`swift-transformers` is a collection of utilities to help adopt language models in Swift apps.
16
16
17
-
It tries to follow the Python `transformers` API and abstractions whenever possible, but it also aims to provide an idiomatic Swift interface and does not assume prior familiarity with [`transformers`](https://github.com/huggingface/transformers) or [`tokenizers`](https://github.com/huggingface/tokenizers).
18
-
17
+
Those familiar with the [`transformers`](https://github.com/huggingface/transformers) Python library will find a familiar yet idiomatic Swift API.
19
18
20
19
## Rationale & Overview
21
20
22
21
Check out [our announcement post](https://huggingface.co/blog/swift-coreml-llm).
23
22
24
23
## Modules
25
24
26
-
-`Tokenizers`: Utilities to convert text to tokens and back, with support for Chat Templates and Tools. Follows the abstractions in [`tokenizers`](https://github.com/huggingface/tokenizers). Usage example:
25
+
-`Tokenizers`: Utilities to convert text to tokens and back, with support for Chat Templates and Tools. Follows the abstractions in [`tokenizers`](https://github.com/huggingface/tokenizers).
-`Generation`: Algorithms for text generation. Handles tokenization internally. Currently supported ones are: greedy search, top-k sampling, and top-p sampling.
56
+
-`Generation`: Utilities for text generation, handling tokenization for you. Currently supported sampling methods: greedy search, top-k sampling, and top-p sampling.
55
57
-`Models`: Language model abstraction over a Core ML package.
56
58
57
-
58
59
## Usage via SwiftPM
59
60
60
61
To use `swift-transformers` with SwiftPM, you can add this to your `Package.swift`:
@@ -85,25 +86,10 @@ targets: [
85
86
86
87
Using `swift-transformers` in your project? Let us know and we'll add you to the list!
87
88
88
-
## Supported Models
89
-
90
-
You can run inference on Core ML models with `swift-transformers`. Note that Core ML is not required to use the `Tokenizers` or `Hub` modules.
91
-
92
-
This package has been tested with autoregressive language models such as:
93
-
94
-
- GPT, GPT-Neox, GPT-J.
95
-
- SantaCoder.
96
-
- StarCoder.
97
-
- Falcon.
98
-
- Llama 2.
99
-
100
-
Encoder-decoder models such as T5 and Flan are currently _not supported_.
101
-
102
89
## Other Tools
103
90
104
91
-[`swift-chat`](https://github.com/huggingface/swift-chat), a simple app demonstrating how to use this package.
105
92
-[`exporters`](https://github.com/huggingface/exporters), a Core ML conversion package for transformers models, based on Apple's [`coremltools`](https://github.com/apple/coremltools).
106
-
-[`transformers-to-coreml`](https://huggingface.co/spaces/coreml-projects/transformers-to-coreml), a no-code Core ML conversion tool built on `exporters`.
0 commit comments