-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for GPT4o and o200k_base models
This commit should add support for all OpenAI currently available models.
- Loading branch information
1 parent
7f65fe7
commit 53141e4
Showing
6 changed files
with
200,110 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package codec | ||
|
||
import "github.com/dlclark/regexp2" | ||
|
||
func NewO200kBase() *Codec { | ||
o200kBaseVocabOnce.Do(o200kBaseVocabInit) | ||
return &Codec{ | ||
name: "o200k_base", | ||
vocabulary: o200kBaseVocab, | ||
splitRegexp: regexp2.MustCompile( | ||
`[^\r\n\p{L}\p{N}]?[\p{Lu}\p{Lt}\p{Lm}\p{Lo}\p{M}]*[\p{Ll}\p{Lm}\p{Lo}\p{M}]+(?i:'s|'t|'re|'ve|'m|'ll|'d)?|`+ | ||
`[^\r\n\p{L}\p{N}]?[\p{Lu}\p{Lt}\p{Lm}\p{Lo}\p{M}]+[\p{Ll}\p{Lm}\p{Lo}\p{M}]*(?i:'s|'t|'re|'ve|'m|'ll|'d)?|`+ | ||
`\p{N}{1,3}|`+` ?[^\s\p{L}\p{N}]+[\r\n/]*|`+ | ||
`\s*[\r\n]+|`+ | ||
`\s+(?!\S)|`+ | ||
`\s+`, | ||
regexp2.None), | ||
specialTokens: map[string]uint{ | ||
"<|endoftext|>": 199999, | ||
"<|endofprompt|>": 200018, | ||
}, | ||
} | ||
} |
Oops, something went wrong.