Skip to content

Commit b839eb8

Browse files
authored
Fix backend/cpp/llama CMakeList.txt on OSX (#1212)
* Fix backend/cpp/llama CMakeList.txt on OSX - detect OSX and use homebrew libraries * sneak a logging fix in too for gallery debugging * additional logging
1 parent 23b03a7 commit b839eb8

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

backend/cpp/llama/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ set(TARGET grpc-server)
44
set(_PROTOBUF_LIBPROTOBUF libprotobuf)
55
set(_REFLECTION grpc++_reflection)
66

7+
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
8+
link_directories("/opt/homebrew/lib")
9+
include_directories("/opt/homebrew/include")
10+
endif()
11+
712
find_package(absl CONFIG REQUIRED)
813
find_package(Protobuf CONFIG REQUIRED)
914
find_package(gRPC CONFIG REQUIRED)
@@ -15,8 +20,7 @@ find_program(_GRPC_CPP_PLUGIN_EXECUTABLE grpc_cpp_plugin)
1520
include_directories(${CMAKE_CURRENT_BINARY_DIR})
1621
include_directories(${Protobuf_INCLUDE_DIRS})
1722

18-
message(STATUS "Using protobuf ${Protobuf_VERSION} ${Protobuf_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR}")
19-
23+
message(STATUS "Using protobuf version ${Protobuf_VERSION} | Protobuf_INCLUDE_DIRS: ${Protobuf_INCLUDE_DIRS} | CMAKE_CURRENT_BINARY_DIR: ${CMAKE_CURRENT_BINARY_DIR}")
2024

2125
# Proto file
2226
get_filename_component(hw_proto "../../../../../../pkg/grpc/proto/backend.proto" ABSOLUTE)

pkg/gallery/gallery.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88

99
"github.com/go-skynet/LocalAI/pkg/utils"
1010
"github.com/imdario/mergo"
11+
"github.com/rs/zerolog/log"
1112
"gopkg.in/yaml.v2"
1213
)
1314

@@ -166,7 +167,9 @@ func getGalleryModels(gallery Gallery, basePath string) ([]*GalleryModel, error)
166167
return yaml.Unmarshal(d, &models)
167168
})
168169
if err != nil {
169-
170+
if yamlErr, ok := err.(*yaml.TypeError); ok {
171+
log.Debug().Msgf("YAML errors: %s\n\nwreckage of models: %+v", strings.Join(yamlErr.Errors, "\n"), models)
172+
}
170173
return models, err
171174
}
172175

0 commit comments

Comments
 (0)