Compare commits

...

3 Commits

Author SHA1 Message Date
leejet
09cab2a2ae chore: set default BUILD_SHARED_LIBS to OFF 2023-10-22 14:59:03 +08:00
leejet
69e54ace14 sync: update ggml 2023-10-22 14:11:06 +08:00
Robert Bledsaw
29a56f2e98 docs: update README.md (#71)
fixed type in curl command.
2023-10-22 13:03:32 +08:00
4 changed files with 9 additions and 8 deletions

View File

@@ -24,6 +24,7 @@ endif()
# general
#option(SD_BUILD_TESTS "sd: build tests" ${SD_STANDALONE})
option(SD_BUILD_EXAMPLES "sd: build examples" ${SD_STANDALONE})
option(BUILD_SHARED_LIBS "sd: build shared libs" OFF)
#option(SD_BUILD_SERVER "sd: build server example" ON)

View File

@@ -72,7 +72,7 @@ git submodule update
```shell
curl -L -O https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt
# curl -L -O https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors
# curl -L -o https://huggingface.co/stabilityai/stable-diffusion-2-1/blob/main/v2-1_768-nonema-pruned.safetensors
# curl -L -O https://huggingface.co/stabilityai/stable-diffusion-2-1/blob/main/v2-1_768-nonema-pruned.safetensors
```
- convert weights to ggml model format

2
ggml

Submodule ggml updated: 6958cd05c7...a0811d8181

View File

@@ -586,7 +586,7 @@ struct ResidualAttentionBlock {
// layer norm 1
{
x = ggml_norm(ctx, x);
x = ggml_norm(ctx, x, 1e-6f);
x = ggml_add(ctx,
ggml_mul(ctx, ggml_repeat(ctx, ln1_w, x), x),
ggml_repeat(ctx, ln1_b, x));
@@ -636,7 +636,7 @@ struct ResidualAttentionBlock {
// layer norm 2
{
x = ggml_norm(ctx, x);
x = ggml_norm(ctx, x, 1e-6f);
x = ggml_add(ctx, ggml_mul(ctx, ggml_repeat(ctx, ln2_w, x), x),
ggml_repeat(ctx, ln2_b, x));
@@ -766,7 +766,7 @@ struct CLIPTextModel {
// final layer norm
{
x = ggml_norm(ctx, x);
x = ggml_norm(ctx, x, 1e-6f);
x = ggml_add(ctx, ggml_mul(ctx, ggml_repeat(ctx, final_ln_w, x), x),
ggml_repeat(ctx, final_ln_b, x));
@@ -1200,7 +1200,7 @@ struct SpatialTransformer {
// layer norm 1
{
x = ggml_reshape_2d(ctx, x, c, w * h * n);
x = ggml_norm(ctx, x);
x = ggml_norm(ctx, x, 1e-6f);
x = ggml_add(ctx,
ggml_mul(ctx,
ggml_repeat(ctx, transformer.norm1_w, x),
@@ -1248,7 +1248,7 @@ struct SpatialTransformer {
// layer norm 2
{
x = ggml_norm(ctx, x);
x = ggml_norm(ctx, x, 1e-6f);
x = ggml_add(ctx,
ggml_mul(ctx,
ggml_repeat(ctx, transformer.norm2_w, x), x),
@@ -1299,7 +1299,7 @@ struct SpatialTransformer {
// layer norm 3
{
x = ggml_reshape_2d(ctx, x, c, h * w * n); // [N * h * w, in_channels]
x = ggml_norm(ctx, x);
x = ggml_norm(ctx, x, 1e-6f);
x = ggml_add(ctx,
ggml_mul(ctx,
ggml_repeat(ctx, transformer.norm3_w, x), x),