Skip to content

Commit

Permalink
style: cleaned up a few print statements.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rexwang8 committed May 19, 2024
1 parent 11c7b17 commit 741198f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion gpt_bpe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,6 @@ func TestLlamaTwoEncodeDecode(t *testing.T) {
func TestMistralEncoder_Encode(t *testing.T) {
testString := "The fox jumped over the hare.\nThe turtle is faster than the hare."
mistralTokens := mistralEncoder.Encode(&testString)
fmt.Printf("mistralTokens: %v\n", mistralTokens)
assert.Equal(t, mistralTokens, &Tokens{1, 415, 285, 1142, 14949, 754, 272, 295, 492, 28723, 13, 1014, 261, 3525, 291, 349, 9556, 821, 272, 295, 492, 28723})
}

Expand Down
9 changes: 4 additions & 5 deletions resources/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (rsrc *Resources) GetFile(name string) (interface{}, error) {
if rsrcEntry, ok := (*rsrc)[name]; ok {
return rsrcEntry.file, nil
} else {
return nil, errors.New(fmt.Sprintf("resource %s not found", name))
return nil, fmt.Errorf("file %s not found", name)
}
}

Expand Down Expand Up @@ -811,7 +811,7 @@ func ResolveHFFromResources(resources *Resources, hfConfig *HFConfig) (*HFConfig
return nil, err
}
} else {
fmt.Printf("config.json not found in resources\n error: %s", err)
log.Printf("Model file %s, will attempt to skip\n", err)
}

if _, err := resources.GetFile("tokenizer_config.json"); err == nil {
Expand All @@ -820,7 +820,7 @@ func ResolveHFFromResources(resources *Resources, hfConfig *HFConfig) (*HFConfig
return nil, err
}
} else {
fmt.Printf("tokenizer_config.json not found in resources\n error: %s", err)
log.Printf("Model file: %s, will attempt to skip\n", err)

}

Expand Down Expand Up @@ -886,7 +886,6 @@ func ResolveHFFromResources(resources *Resources, hfConfig *HFConfig) (*HFConfig
}

}
fmt.Printf("Resolved config: %v\n", &hfConfig)
return hfConfig, nil
}

Expand All @@ -895,7 +894,7 @@ func ResolveHFFromResources(resources *Resources, hfConfig *HFConfig) (*HFConfig
// local filesystem, or remote.
func ResolveVocabId(vocabId string, token string) (*HFConfig, *Resources, error) {
var resolvedVocabId string
fmt.Printf("Resolving vocab id: %s\n", vocabId)
log.Printf("Resolving vocab id: %s\n", vocabId)
if _, vocabErr := EmbeddedDirExists(vocabId); vocabErr == nil {
endOfText := "<|endoftext|>"
bosText := "<|startoftext|>"
Expand Down

0 comments on commit 741198f

Please sign in to comment.