From 2a9d7474ce5dd886008c79581a368c9ca7865278 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Sun, 14 May 2023 17:49:10 +0200 Subject: [PATCH] fix(rwkv): load tokenizer file from model path (#255) --- pkg/model/initializers.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/model/initializers.go b/pkg/model/initializers.go index 07dbc0c..ab5a9af 100644 --- a/pkg/model/initializers.go +++ b/pkg/model/initializers.go @@ -2,6 +2,7 @@ package model import ( "fmt" + "path/filepath" "strings" rwkv "github.com/donomii/go-rwkv.cpp" @@ -143,7 +144,7 @@ func (ml *ModelLoader) BackendLoader(backendString string, modelFile string, lla case BertEmbeddingsBackend: return ml.LoadModel(modelFile, bertEmbeddings) case RwkvBackend: - return ml.LoadModel(modelFile, rwkvLM(modelFile+tokenizerSuffix, threads)) + return ml.LoadModel(modelFile, rwkvLM(filepath.Join(ml.ModelPath, modelFile+tokenizerSuffix), threads)) case WhisperBackend: return ml.LoadModel(modelFile, whisperModel) default: