Skip to content

dingusxp/rwkv-tokenizer-go

 
 

Repository files navigation

RWKV Tokenizer for Go

Go Reference

This package is a fast implementation of the RWKV World Tokenizer in Go.

The default vocabulary (rwkv_vocab_v20230424) is loaded when you create a tokenizer with NewWorldTokenizer().

Example Usage

package main

import (
	"fmt"
	"github.com/ronsor/rwkv-tokenizer-go"
)

func main() {
        t := rwkvtkn.NewWorldTokenizer()
        x, err := t.EncodeString("Hello, world! こんにちは、世界!")
        fmt.Println(x, err)
        y, err := t.DecodeToString(x)
        fmt.Println(y, err)
}

License

Copyright © 2024 Ronsor Labs. Licensed under the MIT license.

About

RWKV World tokenizer for Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 97.1%
  • Python 2.9%