remove dependency on llm
This commit is contained in:
parent
c0b94376b2
commit
ce15ed6d69
@ -35,8 +35,6 @@ import (
|
||||
"runtime"
|
||||
"strings"
|
||||
"unsafe"
|
||||
|
||||
"github.com/ollama/ollama/llm"
|
||||
)
|
||||
|
||||
func BackendInit() {
|
||||
@ -227,7 +225,7 @@ func (m *Model) Tokenize(text string, maxTokens int, addSpecial bool, parseSpeci
|
||||
return tokens, nil
|
||||
}
|
||||
|
||||
func Quantize(infile, outfile string, ftype llm.FileType) error {
|
||||
func Quantize(infile, outfile string, ftype uint32) error {
|
||||
cinfile := C.CString(infile)
|
||||
defer C.free(unsafe.Pointer(cinfile))
|
||||
|
||||
@ -236,7 +234,7 @@ func Quantize(infile, outfile string, ftype llm.FileType) error {
|
||||
|
||||
params := C.llama_model_quantize_default_params()
|
||||
params.nthread = -1
|
||||
params.ftype = ftype.Value()
|
||||
params.ftype = ftype
|
||||
|
||||
if rc := C.llama_model_quantize(cinfile, coutfile, ¶ms); rc != 0 {
|
||||
return fmt.Errorf("llama_model_quantize: %d", rc)
|
||||
|
@ -209,7 +209,6 @@ func (s *Server) handler(w http.ResponseWriter, r *http.Request) {
|
||||
for i, sq := range s.seqs {
|
||||
if sq == nil {
|
||||
s.seqs[i] = seq
|
||||
fmt.Println("signal")
|
||||
s.cond.Signal()
|
||||
break
|
||||
}
|
||||
|
2
llama/sampling_ext.cpp
vendored
2
llama/sampling_ext.cpp
vendored
@ -17,7 +17,7 @@ struct llama_sampling_context* llama_sampling_cinit(struct llama_sampling_cparam
|
||||
sparams.mirostat_eta = params->mirostat_eta;
|
||||
sparams.penalize_nl = params->penalize_nl;
|
||||
sparams.seed = params->seed;
|
||||
sparams.grammar = std::string(params->grammar);
|
||||
sparams.grammar = params->grammar;
|
||||
return llama_sampling_init(sparams);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user