Skip to content

Commit

Permalink
fix: additional type fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
Sentimentron committed Jul 14, 2020
1 parent 550a82c commit 81098a1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions linear_models/liblinear.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ package linear_models
import "C"
import (
"fmt"
"unsafe"
"runtime"
)

Expand Down Expand Up @@ -36,7 +35,7 @@ func (p *Parameter) Free() {

// Model encapsulates a trained libsvm model.
type Model struct {
c_model unsafe.Pointer
c_model *C.struct_model
}

// Free releases resources associated with a trained libsvm model.
Expand Down Expand Up @@ -112,12 +111,12 @@ func Export(model *Model, filePath string) error {
}

func Load(model *Model, filePath string) error {
model.c_model = unsafe.Pointer(C.load_model(C.CString(filePath)))
model.c_model = C.load_model(C.CString(filePath))
if model.c_model == nil {
return fmt.Errorf("Something went wrong")
}
return nil

}

// Predict takes a row of float values corresponding to a particular
Expand Down
Binary file removed linear_models/tmp
Binary file not shown.

0 comments on commit 81098a1

Please sign in to comment.