Skip to content

Commit 5588fa7

Browse files
committed
refactor(tx): support convert
Signed-off-by: thxCode <thxcode0824@gmail.com>
1 parent 90f9934 commit 5588fa7

File tree

13 files changed

+936
-25
lines changed

13 files changed

+936
-25
lines changed

conditioner.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ struct FrozenCLIPEmbedderWithCustomWords : public Conditioner {
155155
struct ggml_context* embd_ctx = ggml_init(params);
156156
struct ggml_tensor* embd = NULL;
157157
int64_t hidden_size = text_model ? text_model->model.hidden_size : text_model2->model.hidden_size;
158-
auto on_load = [&](const TensorStorage& tensor_storage, ggml_tensor** dst_tensor) {
158+
auto on_load = [&](const TensorStorage& tensor_storage, const SDVersion ver, ggml_tensor** dst_tensor) {
159159
if (tensor_storage.ne[0] != hidden_size) {
160160
LOG_DEBUG("embedding wrong hidden size, got %i, expected %i", tensor_storage.ne[0], hidden_size);
161161
return false;

examples/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
22

33
add_subdirectory(cli)
4+
add_subdirectory(convert)
45
add_subdirectory(stream-cli)

examples/cli/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
set(TARGET sd)
1+
set(TARGET stable-diffusion-cli)
22

33
add_executable(${TARGET} main.cpp)
44
install(TARGETS ${TARGET} RUNTIME)

examples/convert/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
set(TARGET stable-diffusion-convert)
2+
3+
add_executable(${TARGET} main.cpp)
4+
install(TARGETS ${TARGET} RUNTIME)
5+
target_link_libraries(${TARGET} PRIVATE stable-diffusion ${CMAKE_THREAD_LIBS_INIT})
6+
target_compile_features(${TARGET} PUBLIC cxx_std_11)

0 commit comments

Comments
 (0)