Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alfianlosari/GPTTokenizerUI
SwiftUI GUI to calculate tokens used by GPT Models
https://github.com/alfianlosari/GPTTokenizerUI
Last synced: 3 months ago
JSON representation
SwiftUI GUI to calculate tokens used by GPT Models
- Host: GitHub
- URL: https://github.com/alfianlosari/GPTTokenizerUI
- Owner: alfianlosari
- License: mit
- Created: 2023-03-31T03:50:31.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-03-31T04:01:35.000Z (over 1 year ago)
- Last Synced: 2024-07-27T14:34:24.854Z (3 months ago)
- Language: Swift
- Size: 5.86 KB
- Stars: 39
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GPTTokenizerUI
![Alt text](https://imagizer.imageshack.com/v2/640x480q70/922/CEVvrE.png "image")
SwiftUI View for providing GUI to input text and show the tokenization results used by GPT API
For programmatic interface, you can use [GPTEncoder](https://github.com/alfianlosari/GPTEncoder) lib. This library used it under the hood for encoding string and decoding tokens.
The GPT family of models process text using tokens, which are common sequences of characters found in text. The models understand the statistical relationships between these tokens, and excel at producing the next token in a sequence of tokens.
You can use this SwiftUI View to understand how a piece of text would be tokenized by the API, and the total count of tokens in that piece of text.
## Supported Platforms
- iOS
## Installation
### Swift Package Manager
- File > Swift Packages > Add Package Dependency
- Add - Add https://github.com/alfianlosari/GPTTokenizerUI## Usage
```swift
import GPTokenizerUI
import SwiftUI@main
struct MyApp: App {var body: some Scene {
WindowGroup {
NavigationStack {
TokenizerView()
}
}
}
}
```