Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
df411c4b
Commit
df411c4b
authored
Sep 23, 2025
by
yajianggroup
Committed by
Michael Yang
Oct 10, 2025
Browse files
refactor: using testing.B.Loop
Signed-off-by:
yajianggroup
<
yajianggroup@outlook.com
>
parent
3d32249c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
model/bytepairencoding_test.go
model/bytepairencoding_test.go
+3
-3
No files found.
model/bytepairencoding_test.go
View file @
df411c4b
...
@@ -251,7 +251,7 @@ func BenchmarkBytePairEncoding(b *testing.B) {
...
@@ -251,7 +251,7 @@ func BenchmarkBytePairEncoding(b *testing.B) {
bts
:=
bts
[
:
n
]
bts
:=
bts
[
:
n
]
b
.
Run
(
"encode"
+
strconv
.
Itoa
(
n
),
func
(
b
*
testing
.
B
)
{
b
.
Run
(
"encode"
+
strconv
.
Itoa
(
n
),
func
(
b
*
testing
.
B
)
{
b
.
ResetTimer
()
b
.
ResetTimer
()
for
range
b
.
N
{
for
b
.
Loop
()
{
_
,
err
:=
tokenizer
.
Encode
(
string
(
bts
),
true
)
_
,
err
:=
tokenizer
.
Encode
(
string
(
bts
),
true
)
if
err
!=
nil
{
if
err
!=
nil
{
b
.
Fatal
(
err
)
b
.
Fatal
(
err
)
...
@@ -266,7 +266,7 @@ func BenchmarkBytePairEncoding(b *testing.B) {
...
@@ -266,7 +266,7 @@ func BenchmarkBytePairEncoding(b *testing.B) {
}
}
b
.
ResetTimer
()
b
.
ResetTimer
()
for
range
b
.
N
{
for
b
.
Loop
()
{
_
,
err
:=
tokenizer
.
Decode
(
ids
)
_
,
err
:=
tokenizer
.
Decode
(
ids
)
if
err
!=
nil
{
if
err
!=
nil
{
b
.
Fatal
(
err
)
b
.
Fatal
(
err
)
...
@@ -276,7 +276,7 @@ func BenchmarkBytePairEncoding(b *testing.B) {
...
@@ -276,7 +276,7 @@ func BenchmarkBytePairEncoding(b *testing.B) {
b
.
Run
(
"split"
+
strconv
.
Itoa
(
n
),
func
(
b
*
testing
.
B
)
{
b
.
Run
(
"split"
+
strconv
.
Itoa
(
n
),
func
(
b
*
testing
.
B
)
{
b
.
ResetTimer
()
b
.
ResetTimer
()
for
range
b
.
N
{
for
b
.
Loop
()
{
slices
.
Collect
(
tokenizer
.
split
(
string
(
bts
)))
slices
.
Collect
(
tokenizer
.
split
(
string
(
bts
)))
}
}
})
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment