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
2dd029de
Unverified
Commit
2dd029de
authored
Dec 16, 2025
by
Michael Yang
Committed by
GitHub
Dec 16, 2025
Browse files
remove unnecessary code (#13502)
slog is already lazily evaluated so this code is completely redundant
parent
903b1fc9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
11 deletions
+1
-11
model/bytepairencoding.go
model/bytepairencoding.go
+1
-11
No files found.
model/bytepairencoding.go
View file @
2dd029de
...
@@ -2,9 +2,7 @@ package model
...
@@ -2,9 +2,7 @@ package model
import
(
import
(
"cmp"
"cmp"
"fmt"
"iter"
"iter"
"log/slog"
"slices"
"slices"
"strings"
"strings"
...
@@ -245,14 +243,6 @@ func (bpe BytePairEncoding) Encode(s string, addSpecial bool) ([]int32, error) {
...
@@ -245,14 +243,6 @@ func (bpe BytePairEncoding) Encode(s string, addSpecial bool) ([]int32, error) {
return
ids
,
nil
return
ids
,
nil
}
}
type
lazyIdsString
struct
{
ids
[]
int32
}
func
(
l
lazyIdsString
)
LogValue
()
slog
.
Value
{
return
slog
.
AnyValue
(
fmt
.
Sprint
(
l
.
ids
))
}
func
(
bpe
BytePairEncoding
)
Decode
(
ids
[]
int32
)
(
string
,
error
)
{
func
(
bpe
BytePairEncoding
)
Decode
(
ids
[]
int32
)
(
string
,
error
)
{
var
sb
strings
.
Builder
var
sb
strings
.
Builder
for
_
,
id
:=
range
ids
{
for
_
,
id
:=
range
ids
{
...
@@ -277,6 +267,6 @@ func (bpe BytePairEncoding) Decode(ids []int32) (string, error) {
...
@@ -277,6 +267,6 @@ func (bpe BytePairEncoding) Decode(ids []int32) (string, error) {
}
}
}
}
logutil
.
Trace
(
"decoded"
,
"string"
,
sb
.
String
(),
"from"
,
lazyIdsString
{
ids
:
ids
}
)
logutil
.
Trace
(
"decoded"
,
"string"
,
sb
.
String
(),
"from"
,
ids
)
return
sb
.
String
(),
nil
return
sb
.
String
(),
nil
}
}
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