Skip to content

Commit

Permalink
refactor(schema): merge common with local, ref #149
Browse files Browse the repository at this point in the history
  • Loading branch information
iboB committed Oct 17, 2024
1 parent f640927 commit e8d2e27
Show file tree
Hide file tree
Showing 18 changed files with 11 additions and 12 deletions.
1 change: 0 additions & 1 deletion common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ endif()
# public
add_subdirectory(astl)
add_subdirectory(xxhash-cpp)
add_subdirectory(schema)

if(AC_BUILD_TESTS OR AC_BUILD_EXAMPLES OR AC_BUILD_POC)
add_subdirectory(ac-repo-root)
Expand Down
2 changes: 1 addition & 1 deletion inference/dummy/local/code/ac/local/DummyModelSchema.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Alpaca Core
// SPDX-License-Identifier: MIT
//
#include <ac/local/ModelSchema.hpp>
#include <ac/schema/ModelSchema.hpp>

namespace ac::local::schema {

Expand Down
2 changes: 1 addition & 1 deletion inference/dummy/local/tools/generate-schema.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: MIT
//
#include <ac/local/DummyModelSchema.hpp>
#include <ac/local/ModelSchemaGenHelper.hpp>
#include <ac/schema/ModelSchemaGenHelper.hpp>

int main(int argc, char** argv) {
using namespace ac::local::schema;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Alpaca Core
// SPDX-License-Identifier: MIT
//
#include <ac/local/ModelSchema.hpp>
#include <ac/schema/ModelSchema.hpp>

namespace ac::local::schema {

Expand Down
2 changes: 1 addition & 1 deletion inference/llama.cpp/local/tools/generate-schema.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: MIT
//
#include <ac/local/LlamaModelSchema.hpp>
#include <ac/local/ModelSchemaGenHelper.hpp>
#include <ac/schema/ModelSchemaGenHelper.hpp>

int main(int argc, char** argv) {
using namespace ac::local::schema;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Alpaca Core
// SPDX-License-Identifier: MIT
//
#include <ac/local/ModelSchema.hpp>
#include <ac/schema/ModelSchema.hpp>

namespace ac::local::schema {

Expand Down
2 changes: 1 addition & 1 deletion inference/whisper/local/tools/generate-schema.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: MIT
//
#include <ac/local/WhisperModelSchema.hpp>
#include <ac/local/ModelSchemaGenHelper.hpp>
#include <ac/schema/ModelSchemaGenHelper.hpp>

int main(int argc, char** argv) {
using namespace ac::local::schema;
Expand Down
1 change: 1 addition & 0 deletions local/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
#
add_subdirectory(code)
ac_add_test_subdir()
add_subdirectory(schema)
3 changes: 1 addition & 2 deletions common/schema/CMakeLists.txt → local/schema/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# Copyright (c) Alpaca Core
# SPDX-License-Identifier: MIT
#
ac_dep(nl-json)
ac_dep(magic_enum)

add_library(ac-schema INTERFACE)
add_library(ac::schema ALIAS ac-schema)
target_link_libraries(ac-schema INTERFACE
nlohmann_json::nlohmann_json
ac::dict
magic_enum::magic_enum
)
target_include_directories(ac-schema INTERFACE code)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//
#pragma once
#include <ac/Dict.hpp>
#include <ac/schema/SchemaItem.hpp>
#include "SchemaItem.hpp"
#include <astl/tuple_util.hpp>

// here we use tuples to define instances within a model and operations within an instance
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ endmacro()

schema_test(SchemaItem)
schema_test(SchemaEnum)
schema_test(ModelSchema)
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Alpaca Core
// SPDX-License-Identifier: MIT
//
#include <ac/local/ModelSchema.hpp>
#include <ac/schema/ModelSchema.hpp>
#include <doctest/doctest.h>

using namespace ac::local::schema;
Expand Down
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion local/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ endmacro()

add_local_test(ProgressCb)
add_local_test(ModelFactory)
add_local_test(ModelSchema)

0 comments on commit e8d2e27

Please sign in to comment.